[Haskell-cafe] Different semantics in "identical" do statement?

staafmeister g.c.stavenga at uu.nl
Fri Oct 9 17:43:49 EDT 2009

In my program

  x <- do
    blah <- someFunc
    return blah
  return $ Constructor x

behaves differently from
  blah <- someFunc
  return $ Constructor blah

where the dots are identical. I would think that these programs should
behave identically, by the monad laws.
The result of my program is that the second gives correct behaviour, while
the first loops forever.

View this message in context: http://www.nabble.com/Different-semantics-in-%22identical%22-do-statement--tp25828319p25828319.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

More information about the Haskell-Cafe mailing list