[Haskell-cafe] Using unsafePerformIO

Dinh Tien Tuan Anh tuananhbirm at hotmail.com
Mon Aug 1 06:06:14 EDT 2005

>AFAICS it is safe provided..
>  f always returns the same value for a given argument list
>  f has no observable side effects.

What are called "side effects" ?

>It looks to me like what you're trying to do is run three parallel
>evaluation algorithms and take the answer from whichever one
>delivers an answer first (via the MVar, which should be empty

Yes, thats what im trying to do

>  f1,f2,f3 all deliver the same answer (if they deliver an answer at all)
>  that answer depends on nothing but xs
>  none of them have any observable side effects
>  I guess you're probably safe.

depends on value of the first two elements of the list, f1, f2 and f3 will 
return three different values. So is it safe ?

Winks & nudges are here - download MSN Messenger 7.0 today! 

More information about the Haskell-Cafe mailing list