/caterwaul/Category/Endofunctor/duoidal

Copy path to clipboard

NB: This is defined in terms of the monoidal categories instead of the other way around because this is more restrictive than either monoidal category.

When you combine these two restrictions, you end up only being able to support endofunctors in Set.

Source

{-|

**NB**: This is defined in terms of the monoidal categories instead of the other
way around because this is more restrictive than either monoidal category.
- Applicative requires that the target category is **Set** and
- monadic requires an endofunctor`object`.

When you combine these two restrictions, you end up only being able to support
endofunctors in **Set**.
-}
let kCat = ../Cat/semigroupal

let vObject = Type

let object = Type

in λ(v : ../../Category/Kind kCat Type vObject) →
λ(cat : ../../Category/Monoidal/Kind kCat vObject object) →
let applicative = ../Functor/monoidal object v cat cat

let monadic =
./monoidal/monadic
object
v
(../../Category/Monoidal/extractCategory kCat vObject object cat)

in { constraint = monadic.constraint
, arrow = applicative.arrow
, diamond =
{ unit = applicative.unit, product = applicative.product }
, star = { unit = monadic.unit, product = monadic.product }
}
: ../Duoidal/Kind kCat vObject (kCat.arrow object object)