On 09.10.2011, at 17:56, wagne...@seas.upenn.edu wrote:

> Quoting Jean-Marie Gaillourdet <j...@gaillourdet.net>:
> 
>> That sounds plausible. Do you see any workaround? Perhaps repeatedly 
>> evaluating typeOf?
> 
> If there's a concurrency bug, surely the workaround is to protect calls to 
> the non-thread-safe function with a lock.
> 
>    typeOfWorkaround lock v = do
>        () <- takeMVar lock
>        x <- evaluate (typeOf v)
>        putMVar lock ()
>        return x

Yes, but this workaround is in the IO monad while mine is not.

Jean


_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to