Jim Burton wrote:
After posting I realised the difference between parsing "(a)" <|> "(b)" and
parsing "a" <|> "aa" ... so Parsec doesn't do the latter well or at all?

It should do (try "aa") <|> "a" just fine. If you mean a general sequence of "a"s then (many1 (char "a")) should do.

The Morse Code problem is a little harder though. To handle the ambiguity you may need to simultaneously consider possible parses of the dots and dashes. I suggest you look into using the List monad. As for the actual parsing of the dots and dashes, Parsec may be overkill.

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to