[Haskell-cafe] Splitting off many/some from Alternative

Gregory Crosswhite gcrosswhite at gmail.com
Wed Dec 14 10:21:25 CET 2011


On Dec 14, 2011, at 4:40 PM, Ivan Lazar Miljenovic wrote:

> [...] Apart from some
> basic combinators in Control.Monad or the definitions of monad
> transformers, how much of what you write in do-blocks is applicable to
> some generic Monad instance as opposed to a specific Monad?

Well, if my *only* constraint on a type is that it be an instance of Monad, then *all* of the code written in do-blocks will be applicable to a generic Monad instance.  That's the whole point.  :-)

Furthermore, you make it sound like this generic case scenario is incredibly rare, but in fact it is very common:  it occurs whenever someone writes a monadic transformer, which happens all the time.  Imagine what writing monadic transformers would be like if you couldn't always trust that, say, (>>=) was a well-defined operation?

Cheers,
Greg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20111214/7a824672/attachment.htm>


More information about the Haskell-Cafe mailing list