proarrow
Safe HaskellNone
LanguageGHC2024

Proarrow.Promonad.State

Documentation

type State (s :: k) = StateT s (Id :: k -> k -> Type) Source Github #

pattern State :: forall {k} a b s. (Monoidal k, Ob s) => (Ob a, Ob b) => ((s ** a) ~> (s ** b)) -> State s a b Source Github #

newtype StateT (s :: k) (p :: k +-> k) (a :: k) (b :: k) where Source Github #

Constructors

StateT :: forall {k} (s :: k) (p :: k +-> k) (a :: k) (b :: k). ((Reader ('OP s) :.: p) :.: Writer s) a b -> StateT s p a b 

Instances

Instances details
(Strong k p, Ob s, SelfAction k) => Strong k (StateT s p :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Promonad.State

Methods

act :: forall (a :: k) (b :: k) (x :: k) (y :: k). (a ~> b) -> StateT s p x y -> StateT s p (Act a x) (Act b y) Source Github #

(SymMonoidal k, Ob s) => MonoidalProfunctor (State s :: k -> k -> Type) Source Github #

Note: This is only premonoidal, not monoidal.

Instance details

Defined in Proarrow.Promonad.State

Methods

par0 :: State s (Unit :: k) (Unit :: k) Source Github #

par :: forall (x1 :: k) (x2 :: k) (y1 :: k) (y2 :: k). State s x1 x2 -> State s y1 y2 -> State s (x1 ** y1) (x2 ** y2) Source Github #

(Profunctor p, Monoidal k, Ob s) => Profunctor (StateT s p :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Promonad.State

Methods

dimap :: forall (c :: k) (a :: k) (b :: k) (d :: k). (c ~> a) -> (b ~> d) -> StateT s p a b -> StateT s p c d Source Github #

lmap :: forall (c :: k) (a :: k) (b :: k). (c ~> a) -> StateT s p a b -> StateT s p c b Source Github #

rmap :: forall (b :: k) (d :: k) (a :: k). (b ~> d) -> StateT s p a b -> StateT s p a d Source Github #

(\\) :: forall (a :: k) (b :: k) r. ((Ob a, Ob b) => r) -> StateT s p a b -> r Source Github #

(Corepresentable p, Ob s, SelfAction k, CompactClosed k) => Corepresentable (StateT s p :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Promonad.State

Methods

coindex :: forall (a :: k) (b :: k). StateT s p a b -> (StateT s p %% a) ~> b Source Github #

cotabulate :: forall (a :: k) (b :: k). Ob a => ((StateT s p %% a) ~> b) -> StateT s p a b Source Github #

corepMap :: forall (a :: k) (b :: k). (a ~> b) -> (StateT s p %% a) ~> (StateT s p %% b) Source Github #

trivialCorep :: forall (a :: k). Ob a => StateT s p a (StateT s p %% a) Source Github #

(Representable p, Ob s, SymMonoidal k, Closed k) => Representable (StateT s p :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Promonad.State

Methods

index :: forall (a :: k) (b :: k). StateT s p a b -> a ~> (StateT s p % b) Source Github #

tabulate :: forall (b :: k) (a :: k). Ob b => (a ~> (StateT s p % b)) -> StateT s p a b Source Github #

repMap :: forall (a :: k) (b :: k). (a ~> b) -> (StateT s p % a) ~> (StateT s p % b) Source Github #

trivialRep :: forall (a :: k). Ob a => StateT s p (StateT s p % a) a Source Github #

(Ob s, SelfAction k, Strong k p, Promonad p) => Promonad (StateT s p :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Promonad.State

Methods

id :: forall (a :: k). Ob a => StateT s p a a Source Github #

(.) :: forall (b :: k) (c :: k) (a :: k). StateT s p b c -> StateT s p a b -> StateT s p a c Source Github #

(Monoidal k, Ob s) => Functor (StateT s :: (k +-> k) -> k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Promonad.State

Methods

map :: forall (a :: k +-> k) (b :: k +-> k). (a ~> b) -> StateT s a ~> StateT s b Source Github #

type (StateT s p :: k -> k -> Type) %% (a :: k) Source Github # 
Instance details

Defined in Proarrow.Promonad.State

type (StateT s p :: k -> k -> Type) %% (a :: k) = ((Reader ('OP s) :.: p) :.: Writer s) %% a
type (StateT s p :: k -> k -> Type) % (a :: k) Source Github # 
Instance details

Defined in Proarrow.Promonad.State

type (StateT s p :: k -> k -> Type) % (a :: k) = ((Reader ('OP s) :.: p) :.: Writer s) % a

runStateT :: forall {k} p (s :: k) (a :: k) (b :: k). Profunctor p => StateT s p a b -> p (s ** a) (s ** b) Source Github #

get :: forall {k} (p :: k +-> k) (s :: k). (Promonad p, Monoidal k, Comonoid s) => StateT s p (Unit :: k) s Source Github #

put :: forall {k} (p :: k +-> k) (s :: k). (Promonad p, Monoidal k, Comonoid s) => StateT s p s (Unit :: k) Source Github #