Free Applicative Functors

Paolo Capriotti
(University of Nottingham)
Ambrus Kaposi
(University of Nottingham)

Applicative functors are a generalisation of monads. Both allow the expression of effectful computations into an otherwise pure language, like Haskell. Applicative functors are to be preferred to monads when the structure of a computation is fixed a priori. That makes it possible to perform certain kinds of static analysis on applicative values. We define a notion of free applicative functor, prove that it satisfies the appropriate laws, and that the construction is left adjoint to a suitable forgetful functor. We show how free applicative functors can be used to implement embedded DSLs which can be statically analysed.

In Paul Levy and Neel Krishnaswami: Proceedings 5th Workshop on Mathematically Structured Functional Programming (MSFP 2014), Grenoble, France, 12 April 2014, Electronic Proceedings in Theoretical Computer Science 153, pp. 2–30.
Published: 5th June 2014.

ArXived at: https://dx.doi.org/10.4204/EPTCS.153.2 bibtex PDF
References in reconstructed bibtex, XML and HTML format (approximated).
Comments and questions to: eptcs@eptcs.org
For website issues: webmaster@eptcs.org