reactive-banana-1.3.2.0: Library for functional reactive programming (FRP).
Safe HaskellSafe-Inferred
LanguageHaskell98

Reactive.Banana.Prim.Low.Ref

Synopsis

Mutable references with Unique

data Ref a Source #

A mutable reference which has a Unique associated with it.

Instances

Instances details
NFData (Ref a) Source # 
Instance details

Defined in Reactive.Banana.Prim.Low.Ref

Methods

rnf :: Ref a -> () #

Eq (Ref a) Source # 
Instance details

Defined in Reactive.Banana.Prim.Low.Ref

Methods

(==) :: Ref a -> Ref a -> Bool #

(/=) :: Ref a -> Ref a -> Bool #

Hashable (Ref a) Source # 
Instance details

Defined in Reactive.Banana.Prim.Low.Ref

Methods

hashWithSalt :: Int -> Ref a -> Int #

hash :: Ref a -> Int #

new :: MonadIO m => a -> m (Ref a) Source #

equal :: Ref a -> Ref b -> Bool Source #

read :: MonadIO m => Ref a -> m a Source #

put :: MonadIO m => Ref a -> a -> m () Source #

modify' :: MonadIO m => Ref a -> (a -> a) -> m () Source #

Strictly modify a Ref.

Garbage collection and weak pointers to Ref

addFinalizer :: Ref v -> IO () -> IO () Source #

Add a finalizer to a Ref.

See addFinalizer.

type WeakRef v = Weak (Ref v) Source #

Weak pointer to a Ref.

mkWeak Source #

Arguments

:: Ref k

key

-> v

value

-> Maybe (IO ())

finalizer

-> IO (Weak v) 

Create a weak pointer that associates a key with a value.

See mkWeak.

deRefWeak :: Weak v -> IO (Maybe v) Source #

Dereference a WeakRef.

See deRefWeak.

deRefWeaks :: [Weak v] -> IO [v] Source #

Dereference a list of weak pointers while discarding dead ones.

finalize :: WeakRef v -> IO () Source #

Finalize a WeakRef.

See finalize.