2009/04/17 minh thu <[email protected]>:
> 2009/04/17 Michael Mossey <[email protected]>:
>> I wonder how I can get the manyTill to be happy with eof
>> before finding the //? I tried
>>
>> parseText = manyTill anyChar (try (string "//") <|> eof)
>>
>> but got a type error.
>
> You can use 'notFollowedBy' [...]
You get a type error because `string "//"` parses to a
`String` while `eof` parses to a `()`. Instead you might use:
parseText = manyTill anyChar (try (string "//" >> return ()) <|> eof)
--
Jason Dusek
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe