[Haskell-cafe] An irritating Parsec problem

Andrew Coppin andrewcoppin at btinternet.com
Wed Oct 15 15:45:45 EDT 2008


Philippa Cowderoy wrote:
> On Wed, 15 Oct 2008, Andrew Coppin wrote:
>
>   
>> Philippa Cowderoy wrote:
>>     
>>> expressions = do es <- many1 expression
>>>                  eof
>>>                  return es
>>>   
>>>       
>> Ah - so "eof" fails if it isn't the end of the input?
>>
>>     
>
> eof = notFollowedBy anyChar
>
> (assuming I've got the identifiers right, that's the actual definition 
> too)
>   

OK, well that'll make it fail alright. Now I just gotta figure out how 
to get a sane error message out of it! ;-)

(The example I showed is very simple; real parsers generally aren't.)



More information about the Haskell-Cafe mailing list