[Haskell-cafe] A valuable new combinator for Parsec?

Jeremy Shaw jeremy.shaw at linspireinc.com
Mon Mar 12 15:52:42 EDT 2007

At Mon, 12 Mar 2007 11:24:48 +0100,
Maxime Henrion wrote:

> pmaybe :: GenParser tok st a -> GenParser tok st (Maybe a)
> pmaybe p = option Nothing (p >>= return . Just)
> I've been using it happily with some code of mine.  Do people think
> that it would be generally useful to have in Parsec?

I believe I have written that same combinator a few times myself, so I
vote yes.


More information about the Haskell-Cafe mailing list