I often find myself writing:
Then I decide to change the type of mu
, so instead I want to just write:
Which is just like fmap
but the function can run in the monad. Similar to traverse:
As someone who isn’t a fan of operators, I generally am appreciative of alternative regular plain English word versions of functions, which I find easier to type, read and edit. Currently without defining such a handy name, I have to transform the code to this:
The name for this function is a no-brainer ((>>=)
is now pronnounced “bind”):
For comparison, the not-very-pleasant <$>
and <*>
each have word alternatives, fmap
and ap
.
I submitted this to the haskell libraries mailing list, but include it here for future reference.