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

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

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

Stability | provisional |

Portability | portable |

Safe Haskell | None |

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 = forall b c . 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

# Documentation

The Day convolution of two covariant functors.

`Day f g a -> h a`

is isomorphic to `f a -> Rift g h a`

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

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 | |

type Rep (Day f g) = (Rep f, Rep g) Source |

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