[Haskell-cafe] Why Kleisli composition is not in the Monad signature?
es at ertes.de
Mon Oct 15 13:59:47 CEST 2012
damodar kulkarni <kdamodar2000 at gmail.com> wrote:
> The Monad class makes us define bind (>>=) and unit (return) for our
> Why the Kleisli composition (>=>) or (<=<) is not made a part of Monad
> class instead of bind (>>=)?
> Is there any historical reason behind this?
> The bind (>>=) is not as elegant as (>=>), at least as I find it.
> Am I missing something?
Try to express
do x <- getLine
y <- getLine
print (x, y)
using only Kleisli composition (without cheating). Through cheating
(doing non-categorical stuff) it's possible to implement (>>=) in terms
of (<=<), but as said that's basically breaking the abstraction.
Not to be or to be and (not to be or to be and (not to be or to be and
(not to be or to be and ... that is the list monad.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 836 bytes
Desc: not available
More information about the Haskell-Cafe