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 #

HasInitialObject k => Corepresentable (Rep (Constant '()) :: () -> k -> Type) Source Github #

The left adjoint of the unique functor to the terminal category.

Instance details

Defined in Proarrow.Colimit.Initial

Methods

coindex :: forall (a :: ()) (b :: k). Rep (Constant '()) a b -> (Rep (Constant '()) %% a) ~> b Source Github #

cotabulate :: forall (a :: ()) (b :: k). Ob a => ((Rep (Constant '()) %% a) ~> b) -> Rep (Constant '()) a b Source Github #

corepMap :: forall (a :: ()) (b :: ()). (a ~> b) -> (Rep (Constant '()) %% a) ~> (Rep (Constant '()) %% b) Source Github #

corepUniv :: forall (a :: ()). Ob a => Rep (Constant '()) a (Rep (Constant '()) %% a) Source Github #

HasTerminalObject k => Representable (Corep (Constant '()) :: k -> () -> Type) Source Github #

The right adjoint of the unique functor to the terminal category.

Instance details

Defined in Proarrow.Limit.Terminal

Methods

index :: forall (a :: k) (b :: ()). Corep (Constant '()) a b -> a ~> (Corep (Constant '()) % b) Source Github #

tabulate :: forall (b :: ()) (a :: k). Ob b => (a ~> (Corep (Constant '()) % b)) -> Corep (Constant '()) a b Source Github #

repMap :: forall (a :: ()) (b :: ()). (a ~> b) -> (Corep (Constant '()) % a) ~> (Corep (Constant '()) % b) Source Github #

repUniv :: forall (a :: ()). Ob a => Corep (Constant '()) (Corep (Constant '()) % a) a Source Github #

(CopyDiscard k, HasCoproducts k, Monoid r) => Traversing (Rep (Constant r) :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.Distributive

Methods

traverseP :: forall (t :: k +-> k). (Traversable t, Representable t) => (t :.: Rep (Constant r)) :~> (Rep (Constant r) :.: t) 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
type (Rep (Constant '()) :: () -> k -> Type) %% (a :: ()) Source Github # 
Instance details

Defined in Proarrow.Colimit.Initial

type (Rep (Constant '()) :: () -> k -> Type) %% (a :: ()) = InitialObject :: k
type (Corep (Constant '()) :: k -> () -> Type) % (a :: ()) Source Github # 
Instance details

Defined in Proarrow.Limit.Terminal

type (Corep (Constant '()) :: k -> () -> Type) % (a :: ()) = TerminalObject :: k