On Dec 15, 2011, at 12:36 PM, Antoine Latter wrote:

> Although I'm still not sure why I would be using these operations in
> maybe or list.

You probably wouldn't use these operations directly on Maybe or List, but the 
whole point is that when you are using a typeclass you have cannot assume that 
you know what they underlying type is.  If your algorithm needs to make use of 
many and some, then as long as the type is an instance of Alternative then you 
know that you can do this regardless of what the type actually is.  If certain 
types break your algorithm, then the constraint on the type being Alternative 
is clearly insufficient.

I wish that I had a more concrete example of how this could happen in practice 
off the top of my head --- say, when writing something like an alternative 
stack transformer (analogous to a monad stack transformer).

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

Reply via email to