On Dec 15, 2011, at 5:40 PM, Antoine Latter wrote:

> I said 'combinators', not 'instances'.

Oh!  Okay, that was my bad then.

> A lot of popular parsers
> combinators can be written exclusively from (<|>) and empty, but make
> little sense for List and Maybe, and may not even function properly.
> The 'trifecta' package includes a nice reference:
> 
> http://hackage.haskell.org/packages/archive/trifecta/0.49.1/doc/html/Text-Trifecta-Parser-Combinators.html
> 
> See 'skipSome' through 'chainr1' - I wouldn't be surprised if most of
> these lead to the same infinite loop behavior for Maybe as the stock
> 'many' and 'some' in base.
> 
> These sorts of functions are what Alternative is for.

Okay, I see better now what you mean.  Thank you.

But then, if so much code based on Alternative makes little sense for List and 
Maybe, then maybe this should be a signal they we should remove their instance 
from Alternative?  After all, we already have the Monad typeclass which gives 
them essentially the same functionality.

Cheers,
Greg
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to