[Haskell-cafe] a regressive view of support for imperative
programming in Haskell
hughperkins at gmail.com
Thu Aug 9 01:03:32 EDT 2007
On 8/9/07, ok <ok at cs.otago.ac.nz> wrote:
> We get extra >>, >>=, \, ->, and "in" tokens, but no new parentheses.
Yes exactly. It's the >>= and >> that gets rid of the parentheses, and
reverses the order of the operations.
I cant remember where I saw this, but somewhere there is a monad tutorial
that starts really from the basics, which is that a "do" list is essentially
f (g (h initialvalue ) )
... which we can rewrite as something like:
h initialvalue |> g |> f
.. for a suitable definition of |> , something like (off the top of my head,
almost certainly wrong):
(|>) f g = g f
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe