Andrew Coppin wrote:
->
"to"
<-
"from", or "drawn from" for list comprehensions.
[]
"nil"
More curiosely, that (>>=) function. Why is the Haskell name for it
(>>=), and why is it pronounced "bind"? Neither of these choices make a
lot of sense to me...
(>>=) is chosen as it seems fairly nice when you use a sugar free monadic style,
foo x >>= \y ->
bar y >>= \z ->
return (y+z)
To understand why it's called "bind" look at common sugar for it, e.g. the above
using do-notation and a "let" notation (e.g. monadic- or ]administrative-
(A-)normal form):
do
y <- foo x
z <- bar y
return (y+z)
letM y = foo x in
letM z = bar y in
y + z
So the effect of (>>=) is to bind the value produced by a monadic computation to
some variable. If we view impure languages as implicitly using a monad, their
"let" statements (which bind variables to values) translate to exactly the above.
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe