idris2-profunctors/Data/Profunctor/Functor.idr

30 lines
991 B
Idris
Raw Normal View History

2023-03-04 23:57:12 -05:00
module Data.Profunctor.Functor
import Data.Profunctor.Types
%default total
public export
interface ProfunctorFunctor (0 t : (Type -> Type -> Type) -> k -> k' -> Type) where
promap : Profunctor p => p :-> q -> t p :-> t q
public export
2023-03-05 00:00:50 -05:00
interface ProfunctorFunctor t =>
ProfunctorMonad (0 t : (Type -> Type -> Type) -> Type -> Type -> Type) where
2023-03-04 23:57:12 -05:00
propure : Profunctor p => p :-> t p
projoin : Profunctor p => t (t p) :-> t p
public export
2023-03-05 00:00:50 -05:00
interface ProfunctorFunctor t =>
ProfunctorComonad (0 t : (Type -> Type -> Type) -> Type -> Type -> Type) where
2023-03-04 23:57:12 -05:00
proextract : Profunctor p => t p :-> p
produplicate : Profunctor p => t p :-> t (t p)
2023-03-05 00:00:50 -05:00
public export
interface (ProfunctorFunctor f, ProfunctorFunctor u) =>
ProfunctorAdjunction (0 f : (Type -> Type -> Type) -> Type -> Type -> Type)
(0 u : (Type -> Type -> Type) -> Type -> Type -> Type) | f, u where
prounit : Profunctor p => p :-> u (f p)
procounit : Profunctor p => f (u p) :-> p