2 ms·
> This is why you even have an "Applicative" class of functors for instance, they're the ones that work nicely with the closed monoidal category structure. App
by hither_shores 4y ago
> This is why you even have an "Applicative" class of functors for instance, they're the ones that work nicely with the closed monoidal category structure.
Applicatives still make sense with only monoidal structure: they're monoidal functors `C -> Set`, or more generally `C -> V` for `C` enriched over `V`.
- contravariant 4y agoI'd be interested to see a justification for that, given that the usual definition is essentially "A functor which preserves the internal hom functor". Regardless I hope you can see what I mean when I say the mathematics you need for Haskell is wonky.
- hither_shores 4y ago> I'd be interested to see a justification for that, given that the usual definition is essentially "A functor which preserves the internal hom functor". Applicatives are monoid objects for Day convolution of functors (in the same way that monads are monoid objects for composition of functors) given by the coend `F \otimes G (x) = \int^{i, j} Hom_C(i \otimes j, x) \otimes_V F(i) \otimes_V F(j)`. These coincide with closed functors by currying if we have closed monoidal structure, but remain well-defined without it. Using `<*>` instead of `liftA2` in the typeclass definition is basically a historical accident, and imo a mistake. > Regardless I hope you can see what I mean when I say the mathematics you need for Haskell is wonky. Wonky is too strong, but I agree that it's usually not treated with anything near the appropriate level of detail.