English

Equivalence of Applicative Functors and Multifunctors

Programming Languages 2024-01-26 v1 Logic in Computer Science

Abstract

McBride and Paterson introduced Applicative functors to Haskell, which are equivalent to the lax monoidal functors (with strength) of category theory. Applicative functors F are presented via idiomatic application __:F(AB)FAFB\_\circledast\_ : F (A \to B) \to F A \to F B and laws that are a bit hard to remember. Capriotti and Kaposi observed that applicative functors can be conceived as multifunctors, i.e., by a family liftAn_n : (A1...AnC)FA1...FAnFC(A_1 \to ... \to A_n \to C) \to F A_1 \to ... \to F A_n \to F C of zipWith-like functions that generalize pure (n=0)(n=0), fmap (n=1)(n=1) and liftA2 (n=2)(n=2). This reduces the associated laws to just the first functor law and a uniform scheme of second (multi)functor laws, i.e., a composition law for liftA. In this note, we rigorously prove that applicative functors are in fact equivalent to multifunctors, by interderiving their laws.

Cite

@article{arxiv.2401.14286,
  title  = {Equivalence of Applicative Functors and Multifunctors},
  author = {Andreas Abel},
  journal= {arXiv preprint arXiv:2401.14286},
  year   = {2024}
}

Comments

6 pages

R2 v1 2026-06-28T14:27:15.529Z