proarrow
Safe HaskellNone
LanguageGHC2024

Proarrow.Profunctor.Instance.Constant

Description

The constant functor as a FunctorForRep, sending every object to c. Its representable profunctor Rep (Constant c) is the viewing carrier used by view.

Documentation

data family Constant :: k -> j +-> k Source Github #

Instances

Instances details
(CopyDiscard k, Ob r) => Strong (Tensor :: k -> (k, k) -> Type) (Rep (Constant r) :: k -> k -> Type) Source Github #

The constant functor ignores the acting object: discard it. Only copying/discarding is needed, so this works in biproduct categories as well as cartesian ones.

Instance details

Defined in Proarrow.Category.Monoidal.CopyDiscard

Methods

act :: forall (a :: k) (x :: k) (y :: k). Ob a => Rep (Constant r) x y -> Rep (Constant r) (Act (Tensor :: k -> (k, k) -> Type) a x) (Act (Tensor :: k -> (k, k) -> Type) a y) Source Github #

(Monoidal k, Comonoid r) => MonoidalProfunctor (Corep (Constant r) :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Monoid

Methods

one :: Corep (Constant r) (Unit :: k) (Unit :: k) Source Github #

(**) :: forall (x1 :: k) (x2 :: k) (y1 :: k) (y2 :: k). Corep (Constant r) x1 x2 -> Corep (Constant r) y1 y2 -> Corep (Constant r) (x1 ** y1) (x2 ** y2) Source Github #

(Monoidal k, Monoid r) => MonoidalProfunctor (Rep (Constant r) :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Monoid

Methods

one :: Rep (Constant r) (Unit :: k) (Unit :: k) Source Github #

(**) :: forall (x1 :: k) (x2 :: k) (y1 :: k) (y2 :: k). Rep (Constant r) x1 x2 -> Rep (Constant r) y1 y2 -> Rep (Constant r) (x1 ** y1) (x2 ** y2) Source Github #

(CategoryOf j, CategoryOf k, Ob c) => FunctorForRep (Constant c :: j +-> k) Source Github # 
Instance details

Defined in Proarrow.Profunctor.Instance.Constant

Methods

fmap :: forall (a :: j) (b :: j). (a ~> b) -> (Constant c @ a) ~> (Constant c @ b) Source Github #

(CopyDiscard k, HasCoproducts k, Monoid r) => Strong (CoprodAction :: k -> (COPROD k, k) -> Type) (Rep (Constant r) :: k -> k -> Type) Source Github #

The constant functor absorbs a coproduct action: the injected summand is discarded onto the monoid's unit, so this needs only copying/discarding on the tensor side and coproducts.

Instance details

Defined in Proarrow.Category.Monoidal.Distributive

Methods

act :: forall (a :: COPROD k) (x :: k) (y :: k). Ob a => Rep (Constant r) x y -> Rep (Constant r) (Act (CoprodAction :: k -> (COPROD k, k) -> Type) a x) (Act (CoprodAction :: k -> (COPROD k, k) -> Type) a y) Source Github #

(HasCoproducts k, Ob r) => MonoidalProfunctor (Coprod (Rep (Constant r)) :: COPROD k -> COPROD k -> Type) Source Github # 
Instance details

Defined in Proarrow.Monoid

Methods

one :: Coprod (Rep (Constant r)) (Unit :: COPROD k) (Unit :: COPROD k) Source Github #

(**) :: forall (x1 :: COPROD k) (x2 :: COPROD k) (y1 :: COPROD k) (y2 :: COPROD k). Coprod (Rep (Constant r)) x1 x2 -> Coprod (Rep (Constant r)) y1 y2 -> Coprod (Rep (Constant r)) (x1 ** y1) (x2 ** y2) Source Github #

type (Constant c :: j +-> k) @ (a :: j) Source Github # 
Instance details

Defined in Proarrow.Profunctor.Instance.Constant

type (Constant c :: j +-> k) @ (a :: j) = c