The Proper Definition of (evaluate :: a -> IO a)
Nils Anders Danielsson
nad at cs.chalmers.se
Mon May 7 11:19:50 EDT 2007
On Mon, 07 May 2007, Malcolm Wallace <Malcolm.Wallace at cs.york.ac.uk> wrote:
> Isaac Dupree <isaacdupree at charter.net> wrote:
>
>> The obvious "evaluate x = x `seq` return x" fails one of the following
>> laws for evaluate:
>>
>> evaluate x `seq` y ==> y
>
> I'm not sure why anyone thinks this "law" should hold, since it
> completely changes the known semantics of `seq`. A more accurate law
> would be:
>
> evaluate x `seq` y ==> if x==_|_ then _|_ else y
You seem to be assuming that evaluate ⊥ = ⊥, which is not necessarily
the case.
> Where did you find the erroneous version?
Presumably he found it by reading the documentation for evaluate:
http://haskell.org/ghc/docs/latest/html/libraries/base/Control-Exception.html#7
--
/NAD
More information about the Libraries
mailing list