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

Roman Cheplyaka roma at ro-che.info
Wed Dec 10 17:27:44 UTC 2014


On 10/12/14 19:08, Greg Weber wrote:
> 
> 
> On Wed, Dec 10, 2014 at 8:43 AM, Andreas Abel <andreas.abel at ifi.lmu.de
> <mailto:andreas.abel at ifi.lmu.de>> wrote:
> 
>     On 10.12.2014 17:33, John Lato wrote:
> 
>         I don't really understand why people want this. What's wrong
>         with (=<<)
>         ?  I kind of feel like a named function should be no longer than
>         that.
> 
> 
>     You are right, we do not need a alphabetic version of every
>     operator. We do not have
> 
>       plus = (+)
> 
>     either.  Why take another good name from the user, just to avoid
>     using an operator in parentheses?
> 
> 
> As a default rule, I think every operator should have a named function.
> This is because symbols have no inherit meaning, but words do.
> Math is the exception to the rule. Basic math is universal: someone
> coming from any background will immediately recognize (+), (-), etc.
> Monad operators only seem universal once you have been programming
> Haskell for several years :)

I agree that math is a poor analogy here.

On the other hand, you're suggesting that a newcomer has to memorize two
names instead of one to read Haskell code fluently.

Words do carry a meaning, but the meaning is usually vague and doesn't
tell you what that function does or what its type is.

Roman

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://www.haskell.org/pipermail/libraries/attachments/20141210/afc5278a/attachment.sig>


More information about the Libraries mailing list