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

David Feuer david.feuer at gmail.com
Wed Dec 10 22:13:37 UTC 2014


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
<mail at joachim-breitner.de> wrote:
> 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 at joachim-breitner.dehttp://www.joachim-breitner.de/
>   Jabber: nomeata at joachim-breitner.de  • GPG-Key: 0xF0FBF51F
>   Debian Developer: nomeata at debian.org
>
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>


More information about the Libraries mailing list