proarrow-0: Category theory with a central role for profunctors
Safe HaskellNone
LanguageHaskell2010

Proarrow.Category.Instance.Kleisli

Documentation

newtype KLEISLI (p :: CAT k) Source Comments #

Constructors

KL k 

Instances

Instances details
Monad m => Strong (->) (Updating a b :: Type -> KlCat m -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

Methods

act :: forall a0 b0 x (y :: KlCat m). (a0 -> b0) -> Updating a b x y -> Updating a b (Act a0 x) (Act b0 y) Source Comments #

(Strong w p, Strong ((~>) :: CAT k) p, Promonad p, Monoidal k) => Strong (w :: k +-> k) (Kleisli :: KLEISLI p -> KLEISLI p -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Kleisli

Methods

act :: forall (a :: k) (b :: k) (x :: KLEISLI p) (y :: KLEISLI p). w a b -> Kleisli x y -> Kleisli (Act a x) (Act b y) Source Comments #

Monad m => Profunctor (Updating a b :: Type -> KlCat m -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

Methods

dimap :: forall c a0 (b0 :: KlCat m) (d :: KlCat m). (c ~> a0) -> (b0 ~> d) -> Updating a b a0 b0 -> Updating a b c d Source Comments #

(\\) :: forall a0 (b0 :: KlCat m) r. ((Ob a0, Ob b0) => r) -> Updating a b a0 b0 -> r Source Comments #

(Strong ((~>) :: CAT k) p, Promonad p, Monoidal k) => MonoidalAction k (KLEISLI p) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Kleisli

Methods

unitor :: forall (x :: KLEISLI p). Ob x => Act (Unit :: k) x ~> x Source Comments #

unitorInv :: forall (x :: KLEISLI p). Ob x => x ~> Act (Unit :: k) x Source Comments #

multiplicator :: forall (a :: k) (b :: k) (x :: KLEISLI p). (Ob a, Ob b, Ob x) => Act a (Act b x) ~> Act (a ** b) x Source Comments #

multiplicatorInv :: forall (a :: k) (b :: k) (x :: KLEISLI p). (Ob a, Ob b, Ob x) => Act (a ** b) x ~> Act a (Act b x) Source Comments #

Promonad p => Profunctor (KleisliForget p :: j -> KLEISLI p -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Kleisli

Methods

dimap :: forall (c :: j) (a :: j) (b :: KLEISLI p) (d :: KLEISLI p). (c ~> a) -> (b ~> d) -> KleisliForget p a b -> KleisliForget p c d Source Comments #

(\\) :: forall (a :: j) (b :: KLEISLI p) r. ((Ob a, Ob b) => r) -> KleisliForget p a b -> r Source Comments #

Promonad p => Adjunction (KleisliFree p :: KLEISLI p -> k -> Type) (KleisliForget p :: k -> KLEISLI p -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Kleisli

Methods

unit :: forall (a :: k). Ob a => (KleisliForget p :.: KleisliFree p) a a Source Comments #

counit :: (KleisliFree p :.: KleisliForget p) :~> ((~>) :: CAT (KLEISLI p)) Source Comments #

(Promonad p, StrongProd p) => Monoidal (KLEISLI p) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Kleisli

Associated Types

type Unit 
Instance details

Defined in Proarrow.Category.Instance.Kleisli

type Unit = 'KL (TerminalObject :: k) :: KLEISLI p

Methods

leftUnitor :: forall (a :: KLEISLI p). Ob a => ((Unit :: KLEISLI p) ** a) ~> a Source Comments #

leftUnitorInv :: forall (a :: KLEISLI p). Ob a => a ~> ((Unit :: KLEISLI p) ** a) Source Comments #

rightUnitor :: forall (a :: KLEISLI p). Ob a => (a ** (Unit :: KLEISLI p)) ~> a Source Comments #

rightUnitorInv :: forall (a :: KLEISLI p). Ob a => a ~> (a ** (Unit :: KLEISLI p)) Source Comments #

associator :: forall (a :: KLEISLI p) (b :: KLEISLI p) (c :: KLEISLI p). (Ob a, Ob b, Ob c) => ((a ** b) ** c) ~> (a ** (b ** c)) Source Comments #

associatorInv :: forall (a :: KLEISLI p) (b :: KLEISLI p) (c :: KLEISLI p). (Ob a, Ob b, Ob c) => (a ** (b ** c)) ~> ((a ** b) ** c) Source Comments #

Promonad p => CategoryOf (KLEISLI p) Source Comments #

Every promonad makes a category.

Instance details

Defined in Proarrow.Category.Instance.Kleisli

Associated Types

type (~>) 
Instance details

Defined in Proarrow.Category.Instance.Kleisli

type (~>) = Kleisli :: KLEISLI p -> KLEISLI p -> Type
Promonad p => Profunctor (KleisliFree p :: KLEISLI p -> k -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Kleisli

Methods

dimap :: forall (c :: KLEISLI p) (a :: KLEISLI p) (b :: k) (d :: k). (c ~> a) -> (b ~> d) -> KleisliFree p a b -> KleisliFree p c d Source Comments #

(\\) :: forall (a :: KLEISLI p) (b :: k) r. ((Ob a, Ob b) => r) -> KleisliFree p a b -> r Source Comments #

Promonad p => Promonad (Kleisli :: KLEISLI p -> KLEISLI p -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Kleisli

Methods

id :: forall (a :: KLEISLI p). Ob a => Kleisli a a Source Comments #

(.) :: forall (b :: KLEISLI p) (c :: KLEISLI p) (a :: KLEISLI p). Kleisli b c -> Kleisli a b -> Kleisli a c Source Comments #

(Promonad p, StrongProd p) => MonoidalProfunctor (Kleisli :: KLEISLI p -> KLEISLI p -> Type) Source Comments #

This is not monoidal but premonoidal, i.e. no sliding. So with `par f g` the effects of f happen before the effects of g.

Instance details

Defined in Proarrow.Category.Instance.Kleisli

Methods

par0 :: Kleisli (Unit :: KLEISLI p) (Unit :: KLEISLI p) Source Comments #

par :: forall (x1 :: KLEISLI p) (x2 :: KLEISLI p) (y1 :: KLEISLI p) (y2 :: KLEISLI p). Kleisli x1 x2 -> Kleisli y1 y2 -> Kleisli (x1 ** y1) (x2 ** y2) Source Comments #

Promonad p => Profunctor (Kleisli :: KLEISLI p -> KLEISLI p -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Kleisli

Methods

dimap :: forall (c :: KLEISLI p) (a :: KLEISLI p) (b :: KLEISLI p) (d :: KLEISLI p). (c ~> a) -> (b ~> d) -> Kleisli a b -> Kleisli c d Source Comments #

(\\) :: forall (a :: KLEISLI p) (b :: KLEISLI p) r. ((Ob a, Ob b) => r) -> Kleisli a b -> r Source Comments #

type Act (y :: k) ('KL x :: KLEISLI p) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Kleisli

type Act (y :: k) ('KL x :: KLEISLI p) = 'KL (Act y x) :: KLEISLI p
type UN ('KL :: j -> KLEISLI p) ('KL k :: KLEISLI p) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Kleisli

type UN ('KL :: j -> KLEISLI p) ('KL k :: KLEISLI p) = k
type Unit Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Kleisli

type Unit = 'KL (TerminalObject :: k) :: KLEISLI p
type (~>) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Kleisli

type (~>) = Kleisli :: KLEISLI p -> KLEISLI p -> Type
type Ob (a :: KLEISLI p) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Kleisli

type Ob (a :: KLEISLI p) = (Is ('KL :: k -> KLEISLI p) a, Ob (UN ('KL :: k -> KLEISLI p) a))
type (a :: KLEISLI p) ** (b :: KLEISLI p) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Kleisli

type (a :: KLEISLI p) ** (b :: KLEISLI p) = 'KL (UN ('KL :: k -> KLEISLI p) a && UN ('KL :: k -> KLEISLI p) b) :: KLEISLI p

data Kleisli (a :: KLEISLI p) (b :: KLEISLI p) where Source Comments #

Constructors

Kleisli 

Fields

Instances

Instances details
(Strong w p, Strong ((~>) :: CAT k) p, Promonad p, Monoidal k) => Strong (w :: k +-> k) (Kleisli :: KLEISLI p -> KLEISLI p -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Kleisli

Methods

act :: forall (a :: k) (b :: k) (x :: KLEISLI p) (y :: KLEISLI p). w a b -> Kleisli x y -> Kleisli (Act a x) (Act b y) Source Comments #

Promonad p => Promonad (Kleisli :: KLEISLI p -> KLEISLI p -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Kleisli

Methods

id :: forall (a :: KLEISLI p). Ob a => Kleisli a a Source Comments #

(.) :: forall (b :: KLEISLI p) (c :: KLEISLI p) (a :: KLEISLI p). Kleisli b c -> Kleisli a b -> Kleisli a c Source Comments #

(Promonad p, StrongProd p) => MonoidalProfunctor (Kleisli :: KLEISLI p -> KLEISLI p -> Type) Source Comments #

This is not monoidal but premonoidal, i.e. no sliding. So with `par f g` the effects of f happen before the effects of g.

Instance details

Defined in Proarrow.Category.Instance.Kleisli

Methods

par0 :: Kleisli (Unit :: KLEISLI p) (Unit :: KLEISLI p) Source Comments #

par :: forall (x1 :: KLEISLI p) (x2 :: KLEISLI p) (y1 :: KLEISLI p) (y2 :: KLEISLI p). Kleisli x1 x2 -> Kleisli y1 y2 -> Kleisli (x1 ** y1) (x2 ** y2) Source Comments #

Promonad p => Profunctor (Kleisli :: KLEISLI p -> KLEISLI p -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Kleisli

Methods

dimap :: forall (c :: KLEISLI p) (a :: KLEISLI p) (b :: KLEISLI p) (d :: KLEISLI p). (c ~> a) -> (b ~> d) -> Kleisli a b -> Kleisli c d Source Comments #

(\\) :: forall (a :: KLEISLI p) (b :: KLEISLI p) r. ((Ob a, Ob b) => r) -> Kleisli a b -> r Source Comments #

arr :: forall {k} (p :: PRO k k) (a :: k) (b :: k). Promonad p => (a ~> b) -> Kleisli ('KL a :: KLEISLI p) ('KL b :: KLEISLI p) Source Comments #

data KleisliFree (p :: k +-> k) (a :: KLEISLI p) (b :: k) where Source Comments #

Constructors

KleisliFree :: forall {k} (p :: k +-> k) (a1 :: k) (b :: k). p a1 b -> KleisliFree p ('KL a1 :: KLEISLI p) b 

Instances

Instances details
Promonad p => Adjunction (KleisliFree p :: KLEISLI p -> k -> Type) (KleisliForget p :: k -> KLEISLI p -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Kleisli

Methods

unit :: forall (a :: k). Ob a => (KleisliForget p :.: KleisliFree p) a a Source Comments #

counit :: (KleisliFree p :.: KleisliForget p) :~> ((~>) :: CAT (KLEISLI p)) Source Comments #

Promonad p => Profunctor (KleisliFree p :: KLEISLI p -> k -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Kleisli

Methods

dimap :: forall (c :: KLEISLI p) (a :: KLEISLI p) (b :: k) (d :: k). (c ~> a) -> (b ~> d) -> KleisliFree p a b -> KleisliFree p c d Source Comments #

(\\) :: forall (a :: KLEISLI p) (b :: k) r. ((Ob a, Ob b) => r) -> KleisliFree p a b -> r Source Comments #

data KleisliForget (p :: k +-> k) (a :: k) (b :: KLEISLI p) where Source Comments #

Constructors

KleisliForget :: forall {k} (p :: k +-> k) (a :: k) (b1 :: k). p a b1 -> KleisliForget p a ('KL b1 :: KLEISLI p) 

Instances

Instances details
Promonad p => Profunctor (KleisliForget p :: j -> KLEISLI p -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Kleisli

Methods

dimap :: forall (c :: j) (a :: j) (b :: KLEISLI p) (d :: KLEISLI p). (c ~> a) -> (b ~> d) -> KleisliForget p a b -> KleisliForget p c d Source Comments #

(\\) :: forall (a :: j) (b :: KLEISLI p) r. ((Ob a, Ob b) => r) -> KleisliForget p a b -> r Source Comments #

Promonad p => Adjunction (KleisliFree p :: KLEISLI p -> k -> Type) (KleisliForget p :: k -> KLEISLI p -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Kleisli

Methods

unit :: forall (a :: k). Ob a => (KleisliForget p :.: KleisliFree p) a a Source Comments #

counit :: (KleisliFree p :.: KleisliForget p) :~> ((~>) :: CAT (KLEISLI p)) Source Comments #

type DUAL (a :: KLEISLI p) = 'KL ('OP (UN ('KL :: k -> KLEISLI p) a)) :: KLEISLI (Op p) Source Comments #

type UNDUAL (a :: KLEISLI (Op p)) = 'KL (UN ('OP :: k -> OPPOSITE k) (UN ('KL :: OPPOSITE k -> KLEISLI (Op p)) a)) :: KLEISLI p Source Comments #

type (++) (a :: KLEISLI p) (b :: KLEISLI p) = UNDUAL (DUAL a ** DUAL b) Source Comments #

dual :: forall {k} {p :: CAT k} (a :: KLEISLI p) (b :: KLEISLI p). (a ~> b) -> DUAL b ~> DUAL a Source Comments #

dist :: forall {k} {p :: PRO k k} (a :: KLEISLI p) (b :: KLEISLI p) (c :: KLEISLI p). (BiCCC k, Promonad p, Ob a, Ob b, Ob c) => (a ** (b ++ c)) ~> ((a ** b) ++ (a ** c)) Source Comments #

copy :: forall k (p :: PRO k k) (a :: KLEISLI p). (HasBinaryProducts k, Promonad p, Ob a) => a ~> (a ** a) Source Comments #

discard :: forall k (p :: PRO k k) (a :: KLEISLI p). (HasTerminalObject k, Promonad p, Ob a) => a ~> (Unit :: KLEISLI p) Source Comments #

add :: forall k (p :: PRO k k) (a :: KLEISLI p). (HasBinaryCoproducts k, Promonad p, Ob a) => (a ++ a) ~> a Source Comments #

zero :: forall k (p :: PRO k k) (a :: KLEISLI p). (HasInitialObject k, Promonad p, Ob a) => UNDUAL (Unit :: KLEISLI (Op p)) ~> a Source Comments #