Safe Haskell | None |
---|---|
Language | Haskell2010 |
Parameterized.Control.Monad.Trans.State.Strict
Synopsis
- newtype ManyState (m :: Type -> Type) s a = ManyState {
- runManyState :: StateT s m a
- newtype ChangingState (m :: Type -> Type) st a = ChangingState {
- runChangingState :: At0 st -> m (a, At1 st)
- changingState :: (s -> m (a, t)) -> ChangingState m (s, t) a
Documentation
newtype ManyState (m :: Type -> Type) s a Source #
Given a ManyState that modifies Many a
, and another ManyState that modifes Many b
make a State that accepts Many (AppendUnique a b)
with the compile time constraint that all the types in (AppendUnique a b) are distinct.
Constructors
ManyState | |
Fields
|
Instances
newtype ChangingState (m :: Type -> Type) st a Source #
Given a ChangingState that changes state from s
to t
,
and another ChangingState that changes state from t
to u
make a State that changes from s
to u
with the compile time constraint that all the types in (AppendUnique a b) are distinct.
NB. The state is in the snd position to be consistent with StateT.
Constructors
ChangingState | |
Fields
|
Instances
Applicative m => PPointed (ChangingState m :: Type -> Type -> Type) ((s, s) :: Type) Source # | |||||
Defined in Parameterized.Control.Monad.Trans.State.Strict Methods ppure :: a -> PUnary (ChangingState m) (s, s) a Source # | |||||
Monad m => PApplicative (ChangingState m :: Type -> Type -> Type) ((s, t) :: Type) ((t, u) :: Type) ((s, u) :: Type) Source # | |||||
Defined in Parameterized.Control.Monad.Trans.State.Strict Methods papply :: PUnary (ChangingState m) (s, t) (a -> b) -> PUnary (ChangingState m) (t, u) a -> PUnary (ChangingState m) (s, u) b Source # | |||||
Monad m => PMonad (ChangingState m :: Type -> Type -> Type) ((s, t) :: Type) ((t, u) :: Type) ((s, u) :: Type) Source # | |||||
Defined in Parameterized.Control.Monad.Trans.State.Strict Methods pbind :: PUnary (ChangingState m) (s, t) a -> (a -> PUnary (ChangingState m) (t, u) b) -> PUnary (ChangingState m) (s, u) b Source # | |||||
Functor m => Functor (ChangingState m st) Source # | |||||
Defined in Parameterized.Control.Monad.Trans.State.Strict Methods fmap :: (a -> b) -> ChangingState m st a -> ChangingState m st b # (<$) :: a -> ChangingState m st b -> ChangingState m st a # | |||||
Generic (ChangingState m st a) Source # | |||||
Defined in Parameterized.Control.Monad.Trans.State.Strict Associated Types
Methods from :: ChangingState m st a -> Rep (ChangingState m st a) x # to :: Rep (ChangingState m st a) x -> ChangingState m st a # | |||||
type PUnary (ChangingState m :: Type -> Type -> Type) (st :: Type) Source # | |||||
type Rep (ChangingState m st a) Source # | |||||
Defined in Parameterized.Control.Monad.Trans.State.Strict type Rep (ChangingState m st a) = D1 ('MetaData "ChangingState" "Parameterized.Control.Monad.Trans.State.Strict" "parameterized-0.5.0.0-9XdYlHtOK669I12VWQAEgZ" 'True) (C1 ('MetaCons "ChangingState" 'PrefixI 'True) (S1 ('MetaSel ('Just "runChangingState") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (At0 st -> m (a, At1 st))))) |
changingState :: (s -> m (a, t)) -> ChangingState m (s, t) a Source #
Prefer this to using ChangingState to construct as it results in better type inference
as it avoids ambiguous type variable st