cartesian-profunctors
Safe HaskellNone
LanguageHaskell2010

Data.Profunctor.Cartesian.Free

Synopsis

The free Cartesian profunctor

data FreeCartesian (p :: Type -> Type -> Type) a b Source #

The free Cartesian profunctor.

Constructors

Neutral b 
Cons (Day (,) p (FreeCartesian p) a b) 

Instances

Instances details
ProfunctorMonad FreeCartesian Source # 
Instance details

Defined in Data.Profunctor.Cartesian.Free

Methods

proreturn :: forall (p :: Type -> Type -> Type). Profunctor p => p :-> FreeCartesian p #

projoin :: forall (p :: Type -> Type -> Type). Profunctor p => FreeCartesian (FreeCartesian p) :-> FreeCartesian p #

ProfunctorFunctor FreeCartesian Source # 
Instance details

Defined in Data.Profunctor.Cartesian.Free

Methods

promap :: forall (p :: Type -> Type -> Type) (q :: Type -> Type -> Type). Profunctor p => (p :-> q) -> FreeCartesian p :-> FreeCartesian q #

Cartesian (FreeCartesian p) Source # 
Instance details

Defined in Data.Profunctor.Cartesian.Free

Methods

proUnit :: FreeCartesian p a () Source #

proProduct :: (a -> (a1, a2)) -> ((b1, b2) -> b) -> FreeCartesian p a1 b1 -> FreeCartesian p a2 b2 -> FreeCartesian p a b Source #

(***) :: FreeCartesian p a b -> FreeCartesian p a' b' -> FreeCartesian p (a, a') (b, b') Source #

(&&&) :: FreeCartesian p a b -> FreeCartesian p a b' -> FreeCartesian p a (b, b') Source #

proPower :: forall (n :: Nat) a b. KnownNat n => FreeCartesian p a b -> FreeCartesian p (Finite n -> a) (Finite n -> b) Source #

Profunctor (FreeCartesian p) Source # 
Instance details

Defined in Data.Profunctor.Cartesian.Free

Methods

dimap :: (a -> b) -> (c -> d) -> FreeCartesian p b c -> FreeCartesian p a d #

lmap :: (a -> b) -> FreeCartesian p b c -> FreeCartesian p a c #

rmap :: (b -> c) -> FreeCartesian p a b -> FreeCartesian p a c #

(#.) :: forall a b c q. Coercible c b => q b c -> FreeCartesian p a b -> FreeCartesian p a c #

(.#) :: forall a b c q. Coercible b a => FreeCartesian p b c -> q a b -> FreeCartesian p a c #

Applicative (FreeCartesian p a) Source # 
Instance details

Defined in Data.Profunctor.Cartesian.Free

Methods

pure :: a0 -> FreeCartesian p a a0 #

(<*>) :: FreeCartesian p a (a0 -> b) -> FreeCartesian p a a0 -> FreeCartesian p a b #

liftA2 :: (a0 -> b -> c) -> FreeCartesian p a a0 -> FreeCartesian p a b -> FreeCartesian p a c #

(*>) :: FreeCartesian p a a0 -> FreeCartesian p a b -> FreeCartesian p a b #

(<*) :: FreeCartesian p a a0 -> FreeCartesian p a b -> FreeCartesian p a a0 #

Functor (FreeCartesian p a) Source # 
Instance details

Defined in Data.Profunctor.Cartesian.Free

Methods

fmap :: (a0 -> b) -> FreeCartesian p a a0 -> FreeCartesian p a b #

(<$) :: a0 -> FreeCartesian p a b -> FreeCartesian p a a0 #

liftF :: p a b -> FreeCartesian p a b Source #

foldFree :: forall (q :: Type -> Type -> Type) (p :: Type -> Type -> Type). Cartesian q => (p :-> q) -> FreeCartesian p :-> q Source #

Newtype wrapper

newtype ForgetCartesian (p :: Type -> Type -> Type) a b Source #

Forgets Cartesian instance from a Profunctor.

Constructors

ForgetCartesian 

Fields

Instances

Instances details
Cocartesian p => Cocartesian (ForgetCartesian p) Source # 
Instance details

Defined in Data.Profunctor.Cartesian.Free

Methods

proEmpty :: ForgetCartesian p Void b Source #

proSum :: (a -> Either a1 a2) -> (Either b1 b2 -> b) -> ForgetCartesian p a1 b1 -> ForgetCartesian p a2 b2 -> ForgetCartesian p a b Source #

(+++) :: ForgetCartesian p a b -> ForgetCartesian p a' b' -> ForgetCartesian p (Either a a') (Either b b') Source #

(|||) :: ForgetCartesian p a b -> ForgetCartesian p a' b -> ForgetCartesian p (Either a a') b Source #

proTimes :: forall (n :: Nat) a b. KnownNat n => ForgetCartesian p a b -> ForgetCartesian p (Finite n, a) (Finite n, b) Source #

Profunctor p => Profunctor (ForgetCartesian p) Source # 
Instance details

Defined in Data.Profunctor.Cartesian.Free

Methods

dimap :: (a -> b) -> (c -> d) -> ForgetCartesian p b c -> ForgetCartesian p a d #

lmap :: (a -> b) -> ForgetCartesian p b c -> ForgetCartesian p a c #

rmap :: (b -> c) -> ForgetCartesian p a b -> ForgetCartesian p a c #

(#.) :: forall a b c q. Coercible c b => q b c -> ForgetCartesian p a b -> ForgetCartesian p a c #

(.#) :: forall a b c q. Coercible b a => ForgetCartesian p b c -> q a b -> ForgetCartesian p a c #

Functor (p a) => Functor (ForgetCartesian p a) Source # 
Instance details

Defined in Data.Profunctor.Cartesian.Free

Methods

fmap :: (a0 -> b) -> ForgetCartesian p a a0 -> ForgetCartesian p a b #

(<$) :: a0 -> ForgetCartesian p a b -> ForgetCartesian p a a0 #

Utility functions

assocTup :: ((a, b), c) -> (a, (b, c)) Source #

unassocTup :: (a, (b, c)) -> ((a, b), c) Source #