Data.Functor.Invariant.Day

kan-extensions-5.2.6: Kan extensions, Kan lifts, the Yoneda lemma, and (co)density (co)monads

Copyright | (C) 2018 Brian Mckenna
License | BSD-style (see the file LICENSE)
Maintainer | Edward Kmett <ekmett@gmail.com>
Stability | provisional
Portability | portable
Safe Haskell | None
Language | Haskell2010

Data.Functor.Invariant.Day

Description

The Day convolution of two invariant functors is an invariant functor.

http://ncatlab.org/nlab/show/Day+convolution

Synopsis

- data Day (f :: Type -> Type) (g :: Type -> Type) a = Day (f b) (g c) (b -> c -> a) (a -> (b, c))
- day :: f a -> g b -> Day f g (a, b)
- assoc :: forall (f :: Type -> Type) (g :: Type -> Type) (h :: Type -> Type) a. Day f (Day g h) a -> Day (Day f g) h a
- disassoc :: forall (f :: Type -> Type) (g :: Type -> Type) (h :: Type -> Type) a. Day (Day f g) h a -> Day f (Day g h) a
- swapped :: forall (f :: Type -> Type) (g :: Type -> Type) a. Day f g a -> Day g f a
- intro1 :: f a -> Day Identity f a
- intro2 :: f a -> Day f Identity a
- elim1 :: Invariant f => Day Identity f a -> f a
- elim2 :: Invariant f => Day f Identity a -> f a
- trans1 :: forall f g (h :: Type -> Type) a. (forall x. f x -> g x) -> Day f h a -> Day g h a
- trans2 :: forall g h (f :: Type -> Type) a. (forall x. g x -> h x) -> Day f g a -> Day f h a
- toContravariant :: forall (f :: Type -> Type) (g :: Type -> Type) a. Day f g a -> Day f g a
- toCovariant :: forall (f :: Type -> Type) (g :: Type -> Type) a. Day f g a -> Day f g a

# Documentation

data Day (f :: Type -> Type) (g :: Type -> Type) a #

The Day convolution of two invariant functors.

Constructors

Day (f b) (g c) (b -> c -> a) (a -> (b, c)) |

#### Instances

Instances details

Invariant (Day f g) # |
Instance details Defined in Data.Functor.Invariant.Day Methods invmap :: (a -> b) -> (b -> a) -> Day f g a -> Day f g b #

day :: f a -> g b -> Day f g (a, b) #

Construct the Day convolution

assoc :: forall (f :: Type -> Type) (g :: Type -> Type) (h :: Type -> Type) a. Day f (Day g h) a -> Day (Day f g) h a #

Day convolution provides a monoidal product. The associativity of this monoid is witnessed by `assoc` and `disassoc`.

    assoc . disassoc = id
    disassoc . assoc = id
    invmap f g . assoc = assoc . invmap f g

disassoc :: forall (f :: Type -> Type) (g :: Type -> Type) (h :: Type -> Type) a. Day (Day f g) h a -> Day f (Day g h) a #

Day convolution provides a monoidal product. The associativity of this monoid is witnessed by `assoc` and `disassoc`.

    assoc . disassoc = id
    disassoc . assoc = id
    invmap f g . disassoc = disassoc . invmap f g

swapped :: forall (f :: Type -> Type) (g :: Type -> Type) a. Day f g a -> Day g f a #

The monoid for `Day` convolution on the cartesian monoidal structure is symmetric.

    invmap f g . swapped = swapped . invmap f g

intro1 :: f a -> Day Identity f a #

`Identity` is the unit of `Day` convolution

    intro1 . elim1 = id
    elim1 . intro1 = id

intro2 :: f a -> Day f Identity a #

`Identity` is the unit of `Day` convolution

    intro2 . elim2 = id
    elim2 . intro2 = id

elim1 :: Invariant f => Day Identity f a -> f a #

`Identity` is the unit of `Day` convolution

    intro1 . elim1 = id
    elim1 . intro1 = id

elim2 :: Invariant f => Day f Identity a -> f a #

`Identity` is the unit of `Day` convolution

    intro2 . elim2 = id
    elim2 . intro2 = id

trans1 :: forall f g (h :: Type -> Type) a. (forall x. f x -> g x) -> Day f h a -> Day g h a #

Apply a natural transformation to the left-hand side of a Day convolution.

This respects the naturality of the natural transformation you supplied:

    invmap f g . trans1 fg = trans1 fg . invmap f g

trans2 :: forall g h (f :: Type -> Type) a. (forall x. g x -> h x) -> Day f g a -> Day f h a #

Apply a natural transformation to the right-hand side of a Day convolution.

This respects the naturality of the natural transformation you supplied:

    invmap f g . trans2 fg = trans2 fg . invmap f g

toContravariant :: forall (f :: Type -> Type) (g :: Type -> Type) a. Day f g a -> Day f g a #

Drop the covariant part of the Day convolution.

toCovariant :: forall (f :: Type -> Type) (g :: Type -> Type) a. Day f g a -> Day f g a #

Drop the contravariant part of the Day convolution.