This answer from Conor McBride (pigworker) discusses Applicative
functors that are also containers (data types given by a set of shapes and a family of positions).
Among other things, he mentions that:
- A polymorphic function between two containers has two components: one acting on shapes and one on positions.
- The shape of applicative containers form a monoid under an operation related to the application operation,
<*>
.
I was wondering if a similar analysis can be carried in a categorical setting and if I could reach the same conclusions using category theory (mainly because I feel more at ease with category theory than with dependent type theory).
I know that Applicative
functors are monoidal functors (from (Set, ×, 1)
to (Set, ×, 1)
) and I believe that containers can be regarded as functors shapely over lists (as suggested here or here) – but I'm not very comfortable with this concept or this assertion.
Is this the right way of thinking about applicative containers, as monoidal functors that are shapely over lists?
P.S.: Let me know if you feel that stackoverflow is not the appropriate place to ask this sort of question.