[Haskell-cafe] Re: Control.Exception.evaluate - 'correct definition' not so correct

apfelmus apfelmus at quantentunnel.de
Sat May 3 06:56:38 EDT 2008


Bryan Donlan wrote:
> 
> 	   evaluate x = (return $! x) >>= return
> 
> However, if >>= is strict on its first argument, then this definition is
> no better than (return $! x).

According to the monad law

   f >>= return = f

every (>>=) ought to be strict in its first argument, so it indeed seems 
that the implementation given in the documentation is wrong.


Regards,
apfelmus



More information about the Haskell-Cafe mailing list