reflex-0.1.0: Higher-order Functional Reactive Programming

Safe HaskellSafe-Inferred
LanguageHaskell98

Control.Monad.Ref

Synopsis

Documentation

class Monad m => MonadRef m where Source

Associated Types

type Ref m :: * -> * Source

Methods

newRef :: a -> m (Ref m a) Source

readRef :: Ref m a -> m a Source

writeRef :: Ref m a -> a -> m () Source

atomicModifyRef :: Ref m a -> (a -> (a, b)) -> m b Source

cacheM :: (MonadRef m, MonadRef m', Ref m ~ Ref m') => m' a -> m (m' a, m ()) Source

cacheMWithTry :: (MonadRef m, MonadRef m', Ref m ~ Ref m') => m' a -> m (m' a, m (Maybe a), m ()) Source

memoM :: (MonadRef m, MonadRef m', Ref m ~ Ref m') => m' a -> m (m' a) Source

Not thread-safe or reentrant

replaceRef :: MonadRef m => Ref m a -> a -> m a Source

modifyRef :: MonadRef m => Ref m a -> (a -> a) -> m () Source