[Haskell-cafe] a regressive view of support for imperative programming in Haskell

Hugh Perkins 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
something like:

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...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20070809/f11cd2f4/attachment.htm


More information about the Haskell-Cafe mailing list