[Haskell-beginners] Re: Defining custom parser using Parsec

Heinrich Apfelmus apfelmus at quantentunnel.de
Tue Oct 19 10:53:21 EDT 2010


Brent Yorgey wrote:
> On Mon, Oct 18, 2010 at 04:58:42PM -0500, Jimmy Wylie wrote:
>> I do have one question though.  Do you always have to define your own
>> Applicative instance for GenParser when trying to use the Applicative
>> form? I noticed that both you and also RWH defined your own when
>> explaining this form of Parsec.  Is there no standard
>> Parsec.Applicative in the library.
> 
> I believe Parsec exports an Applicative instance in version 3.0 and
> later, but previous versions of Parsec did not include it.  After all,
> the first few versions of Parsec were written before Applicative was
> invented. =)

That's why have switched to Parsimony[1]. It's a simplified version of 
Parsec with a proper applicative instance.

   [1]: http://hackage.haskell.org/package/parsimony


Regards,
Heinrich Apfelmus

--
http://apfelmus.nfshost.com



More information about the Beginners mailing list