Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
Synopsis
- data Ref a
- getUnique :: Ref a -> Unique
- new :: MonadIO m => a -> m (Ref a)
- equal :: Ref a -> Ref b -> Bool
- read :: MonadIO m => Ref a -> m a
- put :: MonadIO m => Ref a -> a -> m ()
- modify' :: MonadIO m => Ref a -> (a -> a) -> m ()
- addFinalizer :: Ref v -> IO () -> IO ()
- getWeakRef :: Ref a -> WeakRef a
- type WeakRef v = Weak (Ref v)
- mkWeak :: Ref k -> v -> Maybe (IO ()) -> IO (Weak v)
- deRefWeak :: Weak v -> IO (Maybe v)
- deRefWeaks :: [Weak v] -> IO [v]
- finalize :: WeakRef v -> IO ()
Mutable references with Unique
A mutable reference which has a Unique
associated with it.
Garbage collection and weak pointers to Ref
addFinalizer :: Ref v -> IO () -> IO () Source #
Add a finalizer to a Ref
.
See addFinalizer
.
getWeakRef :: Ref a -> WeakRef a Source #
Create a weak pointer that associates a key with a value.
See mkWeak
.
deRefWeaks :: [Weak v] -> IO [v] Source #
Dereference a list of weak pointers while discarding dead ones.