[Haskell-cafe] Confusion on the third monad law when using lambda abstractions

Hans van Thiel hthiel.char at zonnet.nl
Thu Jun 18 07:23:03 EDT 2009


On Wed, 2009-06-17 at 21:26 -0500, Jake McArthur wrote:
> Jon Strait wrote:
> > I'm reading the third (bind associativity) law for monads in this form:
> > 
> > m >>= (\x -> k x >>= h)  =  (m >>= k) >>= h
> 
> Arguably, that law would be better stated as:
> 
>      (h <=< k) <=< m  =  h <=< (k <=< m)
> 
> This wouldn't be so unintuitive.
Hi, 
The only place I've ever seen Kleisli composition, or its flip, used is
in demonstrating the monad laws. Yet it is so elegant and, even having
its own name, it must have some practical use. Do you, or anybody else,
have some pointers?

Best Regards,

Hans van Thiel
> 
> - Jake
> 



More information about the Haskell-Cafe mailing list