Copyright | (C) 2014-2016 Edward Kmett |
---|---|

License | BSD-style (see the file LICENSE) |

Maintainer | Edward Kmett <ekmett@gmail.com> |

Stability | provisional |

Portability | portable |

Safe Haskell | Safe |

Language | Haskell98 |

Eitan Chatav first introduced me to this construction

The Day convolution of two covariant functors is a covariant functor.

Day convolution is usually defined in terms of contravariant functors, however, it just needs a monoidal category, and Hask^op is also monoidal.

Day convolution can be used to nicely describe monoidal functors as monoid objects w.r.t this product.

- data Day f g a = Day (f b) (g c) (b -> c -> a)
- day :: f (a -> b) -> g a -> Day f g b
- dap :: Applicative f => Day f f a -> f a
- assoc :: Day f (Day g h) a -> Day (Day f g) h a
- disassoc :: Day (Day f g) h a -> Day f (Day g h) a
- swapped :: Day f g a -> Day g f a
- intro1 :: f a -> Day Identity f a
- intro2 :: f a -> Day f Identity a
- elim1 :: Functor f => Day Identity f a -> f a
- elim2 :: Functor f => Day f Identity a -> f a
- trans1 :: (forall x. f x -> g x) -> Day f h a -> Day g h a
- trans2 :: (forall x. g x -> h x) -> Day f g a -> Day f h a
- cayley :: Procompose (Cayley f p) (Cayley g q) a b -> Cayley (Day f g) (Procompose p q) a b
- dayley :: Category p => Procompose (Cayley f p) (Cayley g p) a b -> Cayley (Day f g) p a b

# Documentation

The Day convolution of two covariant functors.

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

Comonad f => ComonadTrans (Day f) Source # | |

Functor (Day f g) Source # | |

(Applicative f, Applicative g) => Applicative (Day f g) Source # | |

(Representable f, Representable g) => Distributive (Day f g) Source # | |

(Representable f, Representable g) => Representable (Day f g) Source # | |

(Comonad f, Comonad g) => Comonad (Day f g) Source # | |

(ComonadApply f, ComonadApply g) => ComonadApply (Day f g) Source # | |

type Rep (Day f g) Source # | |

dap :: Applicative f => Day f f a -> f a Source #

cayley :: Procompose (Cayley f p) (Cayley g q) a b -> Cayley (Day f g) (Procompose p q) a b Source #