| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
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
- data WithPure (p :: CAT k) (a :: k) (b :: k) where
- liftWithPure :: forall {k} (p :: k +-> k). Profunctor p => p :~> WithPure p
- lowerWithPure :: forall {k1} (p :: CAT k1). Promonad p => WithPure p :~> p
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
| Strong t p => Strong (t :: (m, k) +-> k) (WithPure p :: k -> k -> Type) Source Github # | |
| (Promonad p, MonoidalProfunctor p) => MonoidalProfunctor (WithPure p :: j -> j -> Type) Source Github # | |
| CategoryOf k => Profunctor (WithPure p :: k -> k -> Type) Source Github # | |
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 # | |
| Functor (WithPure :: CAT k -> k -> k -> Type) 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.