[Haskell-cafe] monad subexpressions

Dan Weston westondan at imageworks.com
Fri Aug 3 16:25:43 EDT 2007


Jules Bean wrote:
> do
>   a <- m
>   b <- n
>   l a x b y
>
> becomes
>
> l (<- m) x (<- n) y
>
> ...with, I suppose, left-to-right evaluation order. This looks 'almost 
> like substitution' which is the goal.

Almost?

So then (flip f) (<- m) (<- n) does *not* equal f (<- n) (<- m) ?

There goes any hope of my understanding future Haskell code. (<- n) sure 
looks like an operator section to me, and more importantly a first class 
Haskell object. What human parsing this would not see a mere function 
application?

And I guess this makes the following complete nonsense:

do
   let a = (<- m)
   let b = (<- n)
   l a x b y

What about

do
   let (b,a) = ((<- n),(<- m))

   -- many lines of code

   l a x b y

Who can say that b was evaluated before a?

I hope the language syntax does not evolve beyond my merely mortal 
ability to desugar it?

Dan Weston



More information about the Haskell-Cafe mailing list