[Haskell-cafe] parsec, how to feed single tokens?

Marc Weber marco-oweber at gmx.de
Fri Jun 23 18:08:59 EDT 2006


Hi. 
I want to write a haskellquickfind app to get a list of files using
human readable hash values (eg the first character of
directory/filenames)

Eg hquickfind vtl
should print /var/tmp/local
My implementation should look like this:

Every folder/file is token and I want to run a parser. to consume /var
Then I want to run it with all subdirs in var where it should fail on
anything but t.* ...
My Problem : I can't access runP directly to feed the parser with one
token and get the result (failure, need more tokens)..

Have I missed a function or isn't parsec meant to be used this way?

Would you recommend writing your own small parser for this?

Another question: Can you use another SourcePos state than SourcePos?

Marc


More information about the Haskell-Cafe mailing list