[Haskell-beginners] functional parser type error

Brent Yorgey byorgey at seas.upenn.edu
Tue Apr 3 20:02:22 CEST 2012


On Mon, Apr 02, 2012 at 09:58:31PM +0100, felipe zapata wrote:
> Hi.
> 
> I'm Following the book of Programming in haskell written by Graham Hutton.
> In Chapter number 8 there is a discussion about functional parsers and it
> is defined a functional Parser item and some basic parsers as follow

How is the Parser type defined?  The problem may be that you need to
make Parser a newtype, and write a Monad instance for it -- if Parser is
defined as a type synonym, then there will be a default Monad instance
used (the one for functions) but that is not the one you want.

-Brent



More information about the Beginners mailing list