
18 Nov
2002
18 Nov
'02
5:32 p.m.
At 2002-11-18 11:05, Sven Panne wrote:
global :: a -> IORef a global a = unsafePerformIO (newIORef a)
This is useful, you can do this with it: ref = global Nothing convert :: a -> IO b convert a = do writeIORef ref (Just a) Just b <- readIORef ref return b -- Ashley Yakeley, Seattle WA

18 Nov
18 Nov
5:40 p.m.
New subject: unsafePerformIO and IORefs
Yes, there are several reasons for having UNSAFE in the name. :-) -- Lennart Ashley Yakeley wrote:
At 2002-11-18 11:05, Sven Panne wrote:
global :: a -> IORef a global a = unsafePerformIO (newIORef a)
This is useful, you can do this with it:
ref = global Nothing
convert :: a -> IO b convert a = do writeIORef ref (Just a) Just b <- readIORef ref return b
8220
Age (days ago)
8220
Last active (days ago)
1 comments
2 participants
participants (2)
-
Ashley Yakeley
-
Lennart Augustsson