[Haskell-cafe] Parse Error ( Parsec )

Joe Quinn headprogrammingczar at gmail.com
Sun Jan 12 13:22:06 UTC 2014


On 1/11/2014 2:42 PM, Hilco Wijbenga wrote:
> On 11 January 2014 11:12, mukesh tiwari <mukeshtiwari.iiitm at gmail.com> wrote:
>> table = [  [ Prefix ( Not <$ string  "~"  ) ]
>>           , [ Infix  ( And <$ string  "&"  ) AssocLeft ]
>>           , [ Infix  ( Or  <$ string "|"   ) AssocLeft ]
>>           , [  Infix  ( Imp <$ string "=>"  ) AssocLeft
>>              , Infix  (  Red <$ string "<=" ) AssocLeft
>>              , Infix  ( Eqi <$ string "<=>" ) AssocLeft
> Have you tried changing the order here? I would expect the "<=>" check
> to have to come before the "<=" check? I haven't played with this so
> I'm just guessing.
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
This would have the same problem, in the other direction. Parsing "a<=b" 
would get to "<", start matching against "<=>", then find "b" instead of 
">" and fail again.


More information about the Haskell-Cafe mailing list