On 27-Apr-2000, Jan Skibinski <[EMAIL PROTECTED]> wrote:
> 
>       currentSecond = second $ unsafePerformIO localDateTime
> 
>       where `localDateTime' has been defined via primitive
>       call to C:
>       
>       localDateTime :: IO DateTime
> 
>       To my distress the clock stopped after the first call to
>       `currentSecond'. I took me much more than just few seconds
>       to realize that the problem was not related to any
>       bug in the C code, but in the signature of
>       `currentSecond':
> 
>               currentSecond :: Int
> 
>       This is all fine and dandy if `currentSecond' is within `where'
>       clause, because it will be always evaluated afresh.

It might happen to work with current Haskell implementations,
but I don't think there's any guarantee of that.

-- 
Fergus Henderson <[EMAIL PROTECTED]>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger [EMAIL PROTECTED]        |     -- the last words of T. S. Garp.

Reply via email to