proarrow
Safe HaskellNone
LanguageGHC2024

Proarrow.Promonad.Pure

Description

A promonad transformer that keeps base morphisms separate from effects. Pure composition and tensor stay in the base category; maps around an effect accumulate in Coyoneda until effects meet or lowerWithPure interprets it. Use KLEISLI (WithPure p) as a category that preserves pure routing. Its tensor has the same compatibility requirements with promonad composition as that of KLEISLI p; ordered effects keep their original order.

Synopsis

Documentation

data WithPure (p :: CAT k) (a :: k) (b :: k) where Source Github #

A base morphism, or an effect with accumulated input and output maps. Equality of interpretations, rather than constructor equality, identifies arrows with the same meaning in the underlying promonad.

Constructors

Pure :: forall {k} (a :: k) (b :: k) (p :: CAT k). (a ~> b) -> WithPure p a b 
Effect :: forall {k} (p :: CAT k) (a :: k) (b :: k). Coyoneda p a b -> WithPure p a b 

Instances

Instances details
Strong t p => Strong (t :: (m, k) +-> k) (WithPure p :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Promonad.Pure

Methods

act :: forall (a :: m) (x :: k) (y :: k). Ob a => WithPure p x y -> WithPure p (Act t a x) (Act t a y) Source Github #

(Promonad p, MonoidalProfunctor p) => MonoidalProfunctor (WithPure p :: j -> j -> Type) Source Github # 
Instance details

Defined in Proarrow.Promonad.Pure

Methods

one :: WithPure p (Unit :: j) (Unit :: j) Source Github #

(**) :: forall (x1 :: j) (x2 :: j) (y1 :: j) (y2 :: j). WithPure p x1 x2 -> WithPure p y1 y2 -> WithPure p (x1 ** y1) (x2 ** y2) Source Github #

CategoryOf k => Profunctor (WithPure p :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Promonad.Pure

Methods

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

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

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

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

Promonad p => Promonad (WithPure p :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Promonad.Pure

Methods

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

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

Functor (WithPure :: CAT k -> k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Promonad.Pure

Methods

map :: forall (a :: CAT k) (b :: CAT k). (a ~> b) -> WithPure a ~> WithPure b Source Github #

liftWithPure :: forall {k} (p :: k +-> k). Profunctor p => p :~> WithPure p Source Github #

Embed an effect without interpreting it.

lowerWithPure :: forall {k1} (p :: CAT k1). Promonad p => WithPure p :~> p Source Github #

Interpret the accumulated maps and effects in the underlying promonad. Lower once and retain the resulting arrow for repeated execution. It sends Pure f to arr f and satisfies lowerWithPure . liftWithPure = id.