[Haskell-cafe] Monadic parser vs. combinator parser

Jan Stolarek jan.stolarek at p.lodz.pl
Thu Jan 31 10:47:12 CET 2013

Thanks for replies guys. I indeed didn't notice that there are monads and applicatives used in 
this parser. My thought that monadic parsers are more verbose came from Hutton's paper where the 
code is definitely less readable than in example I provided.

There is one more thing that bothers me. It is easy to write a parser that returns Nothing when 
parsing fails. But I can't figure out a way to add meaningful error messages so that the user 
knows where did the parsing fail. I experimented with using Either so that I can use Left to pass 
error messages but this turned out to be inflexible and clutered the code. I will be greatful for 
any ideas.


More information about the Haskell-Cafe mailing list