[Haskell-cafe] Why Kleisli composition is not in the Monad signature?

Simon Thompson s.j.thompson at kent.ac.uk
Tue Oct 16 21:45:13 CEST 2012

Not sure I really have anything substantial to contribute, but it's certainly true that if you see

  a -> m b

as a generalisation of the usual function type, a -> b, then return generalises the identity and 
kleisli generalises function composition. This makes the types pretty memorable (and often the 
definitions too).


On 16 Oct 2012, at 20:14, David Thomas <davidleothomas at gmail.com> wrote:

>> class Monad m where
>>  return :: a -> m a
>>  kleisli :: (a -> m b) -> (b -> m c) -> (a -> m c)

Simon Thompson | Professor of Logic and Computation 
School of Computing | University of Kent | Canterbury, CT2 7NF, UK
s.j.thompson at kent.ac.uk | M +44 7986 085754 | W www.cs.kent.ac.uk/~sjt

More information about the Haskell-Cafe mailing list