bind :: Monad m => (a -> m b) -> m a -> m b

Joachim Breitner mail at
Wed Dec 10 21:48:45 UTC 2014


Am Dienstag, den 09.12.2014, 22:44 +0100 schrieb Christopher Done:
> The name for this function is a no-brainer:
> bind :: Monad m => (a -> m b) -> m a -> m b
> bind = (=<<)

Such a function already exists, unfortunately with a slightly too
specialized type. So in the spirit of recent changes to Data.List, let’s
just generalize

        concatMap :: (a -> [b]) -> [a] -> [b]


        concatMap :: Monad m => (a -> m b) -> m a -> m b

and use that existing name.

/me ducks and runs.


PS, jokes aside: I’m not convinced that the need for this is
sufficiently strong, so this proposal, although nice and sensible,
currently does not pass my rather vague threshold for change. Especially
as (=<<) is (syntactically, grammatically) equivalent to a named
function. So count me as -1 for now, unless better arguments arise.

Joachim “nomeata” Breitner
  mail at joachim-breitner.de
  Jabber: nomeata at  • GPG-Key: 0xF0FBF51F
  Debian Developer: nomeata at

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <>

More information about the Libraries mailing list