Pieter Laeremans wrote:
> fileParser :: Parser Content
> fileParser = do
>     title <- manyTill getInput  (string . pack "\nTITLE\n")
>     author <- manyTill getInput (string. pack "\nTITLE\n")
>     ....
>     return Content title author ...
> 
> But this doesn't work.

"getInput" does not consume any input but just returns the remaining
input. Therefore it is called infinitely often. If your input were
String you could use "anyChar" instead. I don't know how to do it with
ByteString (maybe parsec-3?).

> I get a stack overflow.  Obviously I'm not understanding something here.
> Are there any good examples of open source projects which parse
> ByteString data ?
> 
> thanks in advance,

Cheers Christian

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to