Speaking of small functions

Iavor Diatchki iavor.diatchki at gmail.com
Mon Oct 30 01:56:35 EST 2006


hi,
i also think that we should have kleisli composition, it is just as
important as the ordinary composition.  i do prefer the shorter (@@)
notation though.

> Before I or someone else rolls a patch for this, are there any other
> similar functions that fit?
>
> I'm reminded of some of the things from the old Gofer CC prelude,
>
>     http://www.cse.unsw.edu.au/~dons/data/cc.prelude
>
>     (@@)             :: Monad m => (a -> m b) -> (c -> m a) -> (c -> m b)
>     f @@ g            = join . map f . g
>
> Do we have some references in the literature (a Mark Jones paper perhaps?)

are you think of a reference for kleisli composition?  if so, it is a
fairly standard operation and is described in many books and there is
also a wikipedia entry for the kleisli category of a monad.  kleisli
composition should satisfy the usual properties of
composition---associativity and left and right identity (using
'return')---and with the above definition these properties follow from
the monad laws.

-iavor


More information about the Libraries mailing list