| Copyright | 2013-2016 Edward Kmett and Dan Doel |
|---|---|
| License | BSD |
| Maintainer | Edward Kmett <ekmett@gmail.com> |
| Stability | experimental |
| Portability | rank N types |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Data.Functor.Day.Curried
Contents
Description
Synopsis
- newtype Curried (g :: Type -> Type) (h :: Type -> Type) a = Curried {
- runCurried :: forall r. g (a -> r) -> h r
- toCurried :: forall (g :: Type -> Type) k h a. (forall x. Day g k x -> h x) -> k a -> Curried g h a
- fromCurried :: forall (f :: Type -> Type) k h b. Functor f => (forall a. k a -> Curried f h a) -> Day f k b -> h b
- applied :: forall (f :: Type -> Type) g a. Functor f => Day f (Curried f g) a -> g a
- unapplied :: forall g a (f :: Type -> Type). g a -> Curried f (Day f g) a
- adjointToCurried :: forall (f :: Type -> Type) u a. Adjunction f u => u a -> Curried f Identity a
- curriedToAdjoint :: forall (f :: Type -> Type) u a. Adjunction f u => Curried f Identity a -> u a
- composedAdjointToCurried :: forall h (f :: Type -> Type) u a. (Functor h, Adjunction f u) => u (h a) -> Curried f h a
- curriedToComposedAdjoint :: forall (f :: Type -> Type) u h a. Adjunction f u => Curried f h a -> u (h a)
- liftCurried :: Applicative f => f a -> Curried f f a
- lowerCurried :: forall (f :: Type -> Type) g a. Applicative f => Curried f g a -> g a
- rap :: forall (f :: Type -> Type) (g :: Type -> Type) a b (h :: Type -> Type). Functor f => Curried f g (a -> b) -> Curried g h a -> Curried f h b
Right Kan lifts
newtype Curried (g :: Type -> Type) (h :: Type -> Type) a #
Constructors
| Curried | |
Fields
| |
Instances
| (Functor g, g ~ h) => Applicative (Curried g h) # | |
Defined in Data.Functor.Day.Curried | |
| Functor g => Functor (Curried g h) # | |
toCurried :: forall (g :: Type -> Type) k h a. (forall x. Day g k x -> h x) -> k a -> Curried g h a #
The universal property of Curried
fromCurried :: forall (f :: Type -> Type) k h b. Functor f => (forall a. k a -> Curried f h a) -> Day f k b -> h b #
toCurried.fromCurried≡idfromCurried.toCurried≡id
applied :: forall (f :: Type -> Type) g a. Functor f => Day f (Curried f g) a -> g a #
This is the counit of the Day f -| Curried f adjunction
unapplied :: forall g a (f :: Type -> Type). g a -> Curried f (Day f g) a #
This is the unit of the Day f -| Curried f adjunction
adjointToCurried :: forall (f :: Type -> Type) u a. Adjunction f u => u a -> Curried f Identity a #
Curried f Identity a is isomorphic to the right adjoint to f if one exists.
adjointToCurried.curriedToAdjoint≡idcurriedToAdjoint.adjointToCurried≡id
curriedToAdjoint :: forall (f :: Type -> Type) u a. Adjunction f u => Curried f Identity a -> u a #
Curried f Identity a is isomorphic to the right adjoint to f if one exists.
composedAdjointToCurried :: forall h (f :: Type -> Type) u a. (Functor h, Adjunction f u) => u (h a) -> Curried f h a #
Curried f h a is isomorphic to the post-composition of the right adjoint of f onto h if such a right adjoint exists.
curriedToComposedAdjoint :: forall (f :: Type -> Type) u h a. Adjunction f u => Curried f h a -> u (h a) #
Curried f h a is isomorphic to the post-composition of the right adjoint of f onto h if such a right adjoint exists.
curriedToComposedAdjoint.composedAdjointToCurried≡idcomposedAdjointToCurried.curriedToComposedAdjoint≡id
liftCurried :: Applicative f => f a -> Curried f f a #
The natural isomorphism between f and Curried f f.
lowerCurried . liftCurried ≡ id
liftCurried . lowerCurried ≡ id
lowerCurried(liftCurriedx) -- definitionlowerCurried(Curried(<*>x)) -- definition (<*>x) (pureid) -- beta reductionpureid<*>x -- Applicative identity law x
lowerCurried :: forall (f :: Type -> Type) g a. Applicative f => Curried f g a -> g a #
Lower Curried by applying pure id to the continuation.
See liftCurried.