[Haskell-cafe] Should "do 1" compile

Ross Paterson ross at soi.city.ac.uk
Thu May 24 04:18:47 EDT 2007


On Thu, May 24, 2007 at 08:38:15AM +0100, Simon Peyton-Jones wrote:
> So I think it's a bug in the Report.  To fix it, you could try
> 
>         do e = e >>= return
> 
> Which would still respect the dynamic semantics (albeit with a
> gratuitous extra >>=) but would now have the right static semantics

Except that this monad law does not always hold.  Perhaps

	do e = e `asTypeOf` return undefined


More information about the Haskell-Cafe mailing list