4 ms·
IORef is exactly equivalent to any other mutable variable. If you want to write C in Haskell: import Foreign foo = mallocBytes 42 $ \p -> do w
by jrockway 16y ago
IORef is exactly equivalent to any other mutable variable.
If you want to write C in Haskell:
import Foreign
foo = mallocBytes 42 $ \p -> do
whatever <- peek p
poke p $ f whatever
...