
For good or ill, concatMap has already been stolen by Data.Foldable,
so that's not an easy choice.
On Wed, Dec 10, 2014 at 4:48 PM, Joachim Breitner
Hi,
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]
to
concatMap :: Monad m => (a -> m b) -> m a -> m b
and use that existing name.
/me ducks and runs.
Greetings, Joachim
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@joachim-breitner.de • http://www.joachim-breitner.de/ Jabber: nomeata@joachim-breitner.de • GPG-Key: 0xF0FBF51F Debian Developer: nomeata@debian.org
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries