Skip to content


Subversion checkout URL

You can clone with
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

21 lines (14 sloc) 0.383 kb
module IORefRef
( Ref, new, read, write, link )
import Prelude hiding (read)
import Data.IORef
newtype Ref a = Ref (IORef a)
new :: a -> IO (Ref a)
new = fmap Ref . newIORef
read :: Ref a -> IO a
read (Ref ioref) = readIORef ioref
write :: Ref a -> a -> IO ()
write (Ref ioref) = writeIORef ioref
link :: Ref a -> Ref a -> IO ()
link old new = write old =<< read new
Jump to Line
Something went wrong with that request. Please try again.