in-other-words-0.2.0.0: A higher-order effect system where the sky's the limit
Safe HaskellNone
LanguageHaskell2010

Control.Effect.Internal.State

Synopsis

Documentation

data State s :: Effect where Source #

An effect for non-atomic stateful operations.

If you need atomicity, use AtomicState instead.

Constructors

Get :: State s m s 
Put :: s -> State s m () 

newtype StateC s m a Source #

Constructors

StateC 

Fields

Instances

Instances details
MonadBase b m => MonadBase b (StateC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Methods

liftBase :: b α -> StateC s m α #

MonadBaseControl b m => MonadBaseControl b (StateC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Associated Types

type StM (StateC s m) a #

Methods

liftBaseWith :: (RunInBase (StateC s m) b -> b a) -> StateC s m a #

restoreM :: StM (StateC s m) a -> StateC s m a #

MonadTrans (StateC s) Source # 
Instance details

Defined in Control.Effect.Internal.State

Methods

lift :: Monad m => m a -> StateC s m a #

MonadTransControl (StateC s) Source # 
Instance details

Defined in Control.Effect.Internal.State

Associated Types

type StT (StateC s) a #

Methods

liftWith :: Monad m => (Run (StateC s) -> m a) -> StateC s m a #

restoreT :: Monad m => m (StT (StateC s) a) -> StateC s m a #

Monad m => Monad (StateC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Methods

(>>=) :: StateC s m a -> (a -> StateC s m b) -> StateC s m b #

(>>) :: StateC s m a -> StateC s m b -> StateC s m b #

return :: a -> StateC s m a #

Functor m => Functor (StateC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Methods

fmap :: (a -> b) -> StateC s m a -> StateC s m b #

(<$) :: a -> StateC s m b -> StateC s m a #

MonadFix m => MonadFix (StateC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Methods

mfix :: (a -> StateC s m a) -> StateC s m a #

MonadFail m => MonadFail (StateC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Methods

fail :: String -> StateC s m a #

Monad m => Applicative (StateC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Methods

pure :: a -> StateC s m a #

(<*>) :: StateC s m (a -> b) -> StateC s m a -> StateC s m b #

liftA2 :: (a -> b -> c) -> StateC s m a -> StateC s m b -> StateC s m c #

(*>) :: StateC s m a -> StateC s m b -> StateC s m b #

(<*) :: StateC s m a -> StateC s m b -> StateC s m a #

MonadIO m => MonadIO (StateC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Methods

liftIO :: IO a -> StateC s m a #

MonadPlus m => Alternative (StateC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Methods

empty :: StateC s m a #

(<|>) :: StateC s m a -> StateC s m a -> StateC s m a #

some :: StateC s m a -> StateC s m [a] #

many :: StateC s m a -> StateC s m [a] #

MonadPlus m => MonadPlus (StateC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Methods

mzero :: StateC s m a #

mplus :: StateC s m a -> StateC s m a -> StateC s m a #

MonadThrow m => MonadThrow (StateC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Methods

throwM :: Exception e => e -> StateC s m a #

MonadCatch m => MonadCatch (StateC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Methods

catch :: Exception e => StateC s m a -> (e -> StateC s m a) -> StateC s m a #

MonadMask m => MonadMask (StateC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Methods

mask :: ((forall a. StateC s m a -> StateC s m a) -> StateC s m b) -> StateC s m b #

uninterruptibleMask :: ((forall a. StateC s m a -> StateC s m a) -> StateC s m b) -> StateC s m b #

generalBracket :: StateC s m a -> (a -> ExitCase b -> StateC s m c) -> (a -> StateC s m b) -> StateC s m (b, c) #

(Carrier m, Threads (StateT s) (Prims m)) => Carrier (StateC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Associated Types

type Derivs (StateC s m) :: [Effect] Source #

type Prims (StateC s m) :: [Effect] Source #

Methods

algPrims :: Algebra' (Prims (StateC s m)) (StateC s m) a Source #

reformulate :: Monad z => Reformulation' (Derivs (StateC s m)) (Prims (StateC s m)) (StateC s m) z a Source #

algDerivs :: Algebra' (Derivs (StateC s m)) (StateC s m) a Source #

type StT (StateC s) a Source # 
Instance details

Defined in Control.Effect.Internal.State

type StT (StateC s) a = StT (StateT s) a
type Derivs (StateC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

type Derivs (StateC s m) = State s ': Derivs m
type Prims (StateC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

type Prims (StateC s m) = Prims m
type StM (StateC s m) a Source # 
Instance details

Defined in Control.Effect.Internal.State

type StM (StateC s m) a = StM (StateT s m) a

newtype StateLazyC s m a Source #

Constructors

StateLazyC 

Fields

Instances

Instances details
MonadBase b m => MonadBase b (StateLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Methods

liftBase :: b α -> StateLazyC s m α #

MonadBaseControl b m => MonadBaseControl b (StateLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Associated Types

type StM (StateLazyC s m) a #

Methods

liftBaseWith :: (RunInBase (StateLazyC s m) b -> b a) -> StateLazyC s m a #

restoreM :: StM (StateLazyC s m) a -> StateLazyC s m a #

MonadTrans (StateLazyC s) Source # 
Instance details

Defined in Control.Effect.Internal.State

Methods

lift :: Monad m => m a -> StateLazyC s m a #

MonadTransControl (StateLazyC s) Source # 
Instance details

Defined in Control.Effect.Internal.State

Associated Types

type StT (StateLazyC s) a #

Methods

liftWith :: Monad m => (Run (StateLazyC s) -> m a) -> StateLazyC s m a #

restoreT :: Monad m => m (StT (StateLazyC s) a) -> StateLazyC s m a #

Monad m => Monad (StateLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Methods

(>>=) :: StateLazyC s m a -> (a -> StateLazyC s m b) -> StateLazyC s m b #

(>>) :: StateLazyC s m a -> StateLazyC s m b -> StateLazyC s m b #

return :: a -> StateLazyC s m a #

Functor m => Functor (StateLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Methods

fmap :: (a -> b) -> StateLazyC s m a -> StateLazyC s m b #

(<$) :: a -> StateLazyC s m b -> StateLazyC s m a #

MonadFix m => MonadFix (StateLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Methods

mfix :: (a -> StateLazyC s m a) -> StateLazyC s m a #

MonadFail m => MonadFail (StateLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Methods

fail :: String -> StateLazyC s m a #

Monad m => Applicative (StateLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Methods

pure :: a -> StateLazyC s m a #

(<*>) :: StateLazyC s m (a -> b) -> StateLazyC s m a -> StateLazyC s m b #

liftA2 :: (a -> b -> c) -> StateLazyC s m a -> StateLazyC s m b -> StateLazyC s m c #

(*>) :: StateLazyC s m a -> StateLazyC s m b -> StateLazyC s m b #

(<*) :: StateLazyC s m a -> StateLazyC s m b -> StateLazyC s m a #

MonadIO m => MonadIO (StateLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Methods

liftIO :: IO a -> StateLazyC s m a #

MonadPlus m => Alternative (StateLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Methods

empty :: StateLazyC s m a #

(<|>) :: StateLazyC s m a -> StateLazyC s m a -> StateLazyC s m a #

some :: StateLazyC s m a -> StateLazyC s m [a] #

many :: StateLazyC s m a -> StateLazyC s m [a] #

MonadPlus m => MonadPlus (StateLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Methods

mzero :: StateLazyC s m a #

mplus :: StateLazyC s m a -> StateLazyC s m a -> StateLazyC s m a #

MonadThrow m => MonadThrow (StateLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Methods

throwM :: Exception e => e -> StateLazyC s m a #

MonadCatch m => MonadCatch (StateLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Methods

catch :: Exception e => StateLazyC s m a -> (e -> StateLazyC s m a) -> StateLazyC s m a #

MonadMask m => MonadMask (StateLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Methods

mask :: ((forall a. StateLazyC s m a -> StateLazyC s m a) -> StateLazyC s m b) -> StateLazyC s m b #

uninterruptibleMask :: ((forall a. StateLazyC s m a -> StateLazyC s m a) -> StateLazyC s m b) -> StateLazyC s m b #

generalBracket :: StateLazyC s m a -> (a -> ExitCase b -> StateLazyC s m c) -> (a -> StateLazyC s m b) -> StateLazyC s m (b, c) #

(Carrier m, Threads (StateT s) (Prims m)) => Carrier (StateLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Associated Types

type Derivs (StateLazyC s m) :: [Effect] Source #

type Prims (StateLazyC s m) :: [Effect] Source #

type StT (StateLazyC s) a Source # 
Instance details

Defined in Control.Effect.Internal.State

type StT (StateLazyC s) a = StT (StateT s) a
type Derivs (StateLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

type Derivs (StateLazyC s m) = State s ': Derivs m
type Prims (StateLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

type Prims (StateLazyC s m) = Prims m
type StM (StateLazyC s m) a Source # 
Instance details

Defined in Control.Effect.Internal.State

type StM (StateLazyC s m) a = StM (StateT s m) a

class (forall s. Threads (StateT s) p) => StateLazyThreads p Source #

StateLazyThreads accepts the following primitive effects:

Instances

Instances details
(forall s. Threads (StateT s) p) => StateLazyThreads p Source # 
Instance details

Defined in Control.Effect.Internal.State

class (forall s. Threads (StateT s) p) => StateThreads p Source #

StateThreads accepts the following primitive effects:

Instances

Instances details
(forall s. Threads (StateT s) p) => StateThreads p Source # 
Instance details

Defined in Control.Effect.Internal.State