[Haskell-cafe] extending Do notation
silvio
silvio.frischi at gmail.com
Tue May 20 17:10:01 UTC 2014
> I think this translation is wrong. The left-hand side executes the
> side-effects of the ioFunction exactly once. The right-hand side looks
> like it would execute the side-effects of ioFunction everytime res is used.
I knew I should have left the let thing alone. It looks a bit strange to
me too. But think if it this way, it's the {} that does the IO not the let.
I'm not en expert in formality but it should work something like this
stmtpart1 { exp } stmtpart2
should desugar to
x <- exp
stmtpart1 x stmtpart2
but as I said I don't insist on this working in the let case. It's not
the main point.
More information about the Haskell-Cafe
mailing list