State monads don't respect the monad laws in Haskell

Jorge Adriano jadrian@mat.uc.pt
Tue, 14 May 2002 21:48:04 +0100


> One may ask the question: what is seq useful for not in conjunction wit=
h
> unsafePerformIO, other than efficiency.  That, I don't know the answer =
to.

Here is an example.

> main::IO()
> main=3Ddo
>      time1 <- getCPUTime
>      w     <- return $! calcSomething
>      time2 <- getCPUTime
=2E..

J.A.