lensref-0.1.0.5: References which can be joined and on which lenses can be applied

Safe HaskellNone
LanguageHaskell98

Data.LensRef.TestEnv

Synopsis

Documentation

class MonadRegister tm => MonadRegisterRun tm where Source

Associated Types

type AsocT tm :: * Source

Methods

runReg :: (m ~ EffectM tm) => m (AsocT tm) -> (AsocT tm -> m ()) -> tm a -> m (a, m ()) Source

newtype Id Source

Constructors

Id Int 

Instances

newtype Port a Source

Constructors

Port 

Fields

unPort :: Int
 

Instances

Eq (Port a) 
Num (Port a) 
Show (Port a) 

data Inst t a where Source

Constructors

Message :: String -> Inst t () 
Listen :: Show b => Port b -> (b -> Prog t ()) -> Inst t Id 
SetStatus :: Id -> RegionStatusChange -> Inst t () 
ReadI :: Inst t t 
WriteI :: t -> Inst t () 
NewRef :: a -> Inst t (Morph (StateT a (Prog t)) (Prog t)) 

Instances

NewRef (Prog t) 

type Prog t = ProgramT (Inst t) (State (Seq Any)) Source

message :: (MonadRegister m, EffectM m ~ Prog t) => String -> m () Source

listen :: (MonadRegister m, EffectM m ~ Prog t, Show a) => Port a -> (a -> Modifier m ()) -> m () Source

data Inst' a where Source

Constructors

Message' :: String -> Inst' () 
Error' :: String -> Inst' () 
Send :: forall a. Show a => Port a -> a -> Inst' () 

send :: Show a => Port a -> a -> ProgramT Inst' m () Source

tell_ :: MonadWriter [Either a b] m => b -> m () Source

fail' :: MonadWriter [Either (Either a b1) b] m => b1 -> m () Source

unfail :: MonadWriter [Either (Either a b1) b] m => a -> m () Source

handEr :: [Char] -> Writer [Either (Either [Char] [Char]) [Char]] () -> [[Char]] Source

showRes :: [Char] -> ((), [Either (Either [Char] [Char]) [Char]]) -> [[Char]] Source

data Any Source

Constructors

forall x . Any x 

Instances

NewRef (Prog t) 

data Listener m Source

Constructors

forall a . Show a => Listener 

listenerId :: forall m. Lens' (Listener m) Id Source

data ST m Source

Constructors

ST 

Fields

_postponed :: [m]
 
_listeners :: [Listener m]
 
_idcounter :: Int
 
_vars :: Seq Any
 

vars :: forall m. Lens' (ST m) (Seq Any) Source

postponed :: forall m. Lens' (ST m) [m] Source

listeners :: forall m. Lens' (ST m) [Listener m] Source

idcounter :: forall m. Lens' (ST m) Int Source

coeval_ :: forall a b m. (Prog m () -> m) -> Prog m a -> Prog' b -> StateT (ST m) Er (Maybe a, Prog' b) Source

coeval__ :: forall a b m. (Prog m () -> m) -> ProgramViewT (Inst m) (State (Seq Any)) a -> Prog' b -> StateT (ST m) Er (Maybe a, Prog' b) Source

runTest_ :: (Eq a, Show a, m ~ Prog n) => String -> (Prog n () -> n) -> (m n -> (n -> m ()) -> tm a -> m (a, m ())) -> tm a -> Prog' (a, Prog' ()) -> IO () Source

(==?) :: (Eq a, Show a, MonadRegisterRun m, EffectM m ~ Prog (AsocT m)) => a -> a -> m () infix 0 Source

Check an equality.

(==>) :: (Eq a, Show a, MonadRegisterRun m, EffectM m ~ Prog (AsocT m)) => Ref m a -> a -> m () infix 0 Source

Check the current value of a given reference.