ContentsIndex
Org.Org.Semantic.HBase.Category.MonadReference
Synopsis
data Ref m a = MkRef {
getRef :: (m a)
setRef :: (a -> m ())
}
class Monad m => MonadGettableReference m r where
get :: forall a . r a -> m a
class Monad m => MonadSettableReference m r where
set :: forall a . r a -> a -> m ()
class (MonadGettableReference m r, MonadSettableReference m r) => MonadFixedReference m r
modify :: MonadFixedReference m r => r a -> (a -> m a) -> m ()
push :: MonadFixedReference m r => r [a] -> a -> m ()
pop :: MonadFixedReference m r => r [a] -> m (Maybe a)
toRef :: MonadFixedReference m r => r a -> Ref m a
refBind :: MonadFixedReference m r => m a -> (a -> r b) -> Ref m b
class MonadFixedReference m r => SingleMonadReference m r | r -> m
get1 :: SingleMonadReference m r => r a -> m a
set1 :: SingleMonadReference m r => r a -> a -> m ()
remonadRef :: (Monad m1, Monad m2) => (forall a . m1 a -> m2 a) -> Ref m1 b -> Ref m2 b
liftRef :: LiftedMonad m1 m2 => Ref m1 a -> Ref m2 a
class Monad m => MonadCreatable m r where
new :: a -> m (r a)
class (MonadCreatable m r, MonadFixedReference m r) => MonadFullReference m r
class MonadFullReference m r => MonadStandardReference m r | m -> r
newStd :: MonadStandardReference m r => a -> m (r a)
newStdRef :: MonadStandardReference m r => a -> m (Ref m a)
makeSingleEvaluator :: MonadStandardReference m r => m a -> m (m a)
class EqualReference r where
equalReference :: r a -> r a -> Bool
Documentation
data Ref m a
reference structure
Constructors
MkRef
getRef :: (m a)
setRef :: (a -> m ())
Instances
Monad m => MonadGettableReference m (Ref m)
Monad m => MonadSettableReference m (Ref m)
Monad m => SingleMonadReference m (Ref m)
class Monad m => MonadGettableReference m r where
Methods
get :: forall a . r a -> m a
Instances
Monad m => MonadGettableReference m Constant
Monad m => MonadGettableReference m (Ref m)
MonadGettableReference IO IORef
MonadGettableReference m IORef => MonadGettableReference (ExceptionMonad m ex) IORef
MonadGettableReference m IORef => MonadGettableReference (ExceptionContinuationPass (m p) ex) IORef
MonadGettableReference m IORef => MonadGettableReference (GuardContinuationPass u (m p)) IORef
class Monad m => MonadSettableReference m r where
Methods
set :: forall a . r a -> a -> m ()
Instances
Monad m => MonadSettableReference m (Ref m)
MonadSettableReference IO IORef
MonadSettableReference m IORef => MonadSettableReference (ExceptionMonad m ex) IORef
MonadSettableReference m IORef => MonadSettableReference (ExceptionContinuationPass (m p) ex) IORef
MonadSettableReference m IORef => MonadSettableReference (GuardContinuationPass u (m p)) IORef
class (MonadGettableReference m r, MonadSettableReference m r) => MonadFixedReference m r
Instances
(MonadGettableReference m r, MonadSettableReference m r) => MonadFixedReference m r
modify :: MonadFixedReference m r => r a -> (a -> m a) -> m ()
push :: MonadFixedReference m r => r [a] -> a -> m ()
pop :: MonadFixedReference m r => r [a] -> m (Maybe a)
toRef :: MonadFixedReference m r => r a -> Ref m a
refBind :: MonadFixedReference m r => m a -> (a -> r b) -> Ref m b
class MonadFixedReference m r => SingleMonadReference m r | r -> m
same as MonadFixedReference, but with fundep
Instances
Monad m => SingleMonadReference m (Ref m)
get1 :: SingleMonadReference m r => r a -> m a
set1 :: SingleMonadReference m r => r a -> a -> m ()
remonadRef :: (Monad m1, Monad m2) => (forall a . m1 a -> m2 a) -> Ref m1 b -> Ref m2 b
liftRef :: LiftedMonad m1 m2 => Ref m1 a -> Ref m2 a
class Monad m => MonadCreatable m r where
Methods
new :: a -> m (r a)
Instances
Monad m => MonadCreatable m Constant
MonadCreatable IO IORef
MonadCreatable m IORef => MonadCreatable (ExceptionMonad m ex) IORef
MonadCreatable m IORef => MonadCreatable (ExceptionContinuationPass (m p) ex) IORef
MonadCreatable m IORef => MonadCreatable (GuardContinuationPass u (m p)) IORef
class (MonadCreatable m r, MonadFixedReference m r) => MonadFullReference m r
Instances
(MonadCreatable m r, MonadFixedReference m r) => MonadFullReference m r
class MonadFullReference m r => MonadStandardReference m r | m -> r
The MonadStandardReference for a monad is a simple memory-base MonadFullReference. An example is IORef for the IO monad.
Instances
MonadStandardReference IO IORef
MonadStandardReference m IORef => MonadStandardReference (ExceptionMonad m ex) IORef
MonadStandardReference m IORef => MonadStandardReference (ExceptionContinuationPass (m p) ex) IORef
MonadStandardReference m IORef => MonadStandardReference (GuardContinuationPass u (m p)) IORef
newStd :: MonadStandardReference m r => a -> m (r a)
newStdRef :: MonadStandardReference m r => a -> m (Ref m a)
makeSingleEvaluator :: MonadStandardReference m r => m a -> m (m a)
class EqualReference r where
Methods
equalReference :: r a -> r a -> Bool
Instances
EqualReference IORef
Produced by Haddock version 0.6