Abstract
Applicative functors define an interface to computation that is more general, and correspondingly weaker, than that of monads. First used in parser libraries, they are now seeing a wide range of applications. This paper sets out to explore the space of non-monadic applicative functors useful in programming. We work with a generalization, lax monoidal functors, and consider several methods of constructing useful functors of this type, just as transformers are used to construct computational monads. For example, coends, familiar to functional programmers as existential types, yield a range of useful applicative functors, including left Kan extensions. Other constructions are final fixed points, a limited sum construction, and a generalization of the semi-direct product of monoids. Implementations in Haskell are included where possible.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Abbott, M., Altenkirch, T., Ghani, N.: Categories of Containers. In: Gordon, A.D. (ed.) FOSSACS 2003. LNCS, vol. 2620, pp. 23–38. Springer, Heidelberg (2003)
Atkey, R.: What is a categorical model of arrows? Electronic Notes on Theoretical Computer Science 229(5), 19–37 (2011)
Baars, A.I., Löh, A., Doaitse Swierstra, S.: Parsing permutation phrases. Journal of Functional Programming 14(6), 635–646 (2004)
Coutts, D.: Arrows for errors: Extending the error monad (2002); unpublished presentation at the Summer School on Advanced Functional Programming
Eilenberg, S., Kelly, G.M.: Closed categories. In: Eilenberg, S., Harrison, D.K., Röhrl, H., MacLane, S. (eds.) Proceedings of the Conference on Categorical Algebra, pp. 421–562. Springer (1966)
Elliott, C.: Denotational design with type class morphisms. Technical Report 2009-01, LambdaPix (2009)
Hinze, R.: Type Fusion. In: Johnson, M., Pavlovic, D. (eds.) AMAST 2010. LNCS, vol. 6486, pp. 92–110. Springer, Heidelberg (2011)
Hinze, R.: Kan extensions for program optimisation, or: Art and dan explain an old trick. In: Gibbons, J., Nogueira, P. (eds.) Mathematics of Program Construction (2012)
Hughes, J.: Generalising monads to arrows. Science of Computer Programming 37(1-3), 67–111 (2000)
Johann, P., Ghani, N.: A principled approach to programming with nested types in Haskell. Higher-Order and Symbolic Computation 22(2), 155–189 (2009)
Kelly, G.M.: Basic concepts of enriched category theory. London Mathematical Society Lecture Note Series, vol. 64. Cambridge University Press (1982)
Lambek, J., Scott, P.J.: Introduction to Higher Order Categorical Logic. Cambridge Studies in Advanced Mathematics, vol. 7. Cambridge University Press, Cambridge (1986)
Lane, S.M.: Categories for the Working Mathematician. Springer, New York (1971)
Matlage, K., Gill, A.: Every Animation Should Have a Beginning, a Middle, and an End: A Case Study of Using a Functor-Based Animation Language. In: Page, R., Horváth, Z., Zsók, V. (eds.) TFP 2010. LNCS, vol. 6546, pp. 150–165. Springer, Heidelberg (2011)
McBride, C., Paterson, R.: Applicative programming with effects. Journal of Functional Programming 18(1), 1–13 (2008)
Moggi, E.: Computational lambda-calculus and monads. In: Logic in Computer Science, pp. 14–23. IEEE Computer Society Press (1989)
Moggi, E.: An abstract view of programming languages. Technical Report ECS-LFCS-90-113, Laboratory for Foundations of Computer Science, University of Edinburgh (1990)
Swierstra, S.D., Duponcheel, L.: Deterministic, Error-Correcting Combinator Parsers. In: Launchbury, J., Sheard, T., Meijer, E. (eds.) AFP 1996. LNCS, vol. 1129, pp. 184–207. Springer, Heidelberg (1996)
Voigtländer, J.: Asymptotic Improvement of Computations over Free Monads. In: Audebaud, P., Paulin-Mohring, C. (eds.) MPC 2008. LNCS, vol. 5133, pp. 388–403. Springer, Heidelberg (2008)
Wadler, P.: Comprehending monads. Mathematical Structures in Computer Science 2(4), 461–493 (1992)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2012 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Paterson, R. (2012). Constructing Applicative Functors. In: Gibbons, J., Nogueira, P. (eds) Mathematics of Program Construction. MPC 2012. Lecture Notes in Computer Science, vol 7342. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-31113-0_15
Download citation
DOI: https://doi.org/10.1007/978-3-642-31113-0_15
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-31112-3
Online ISBN: 978-3-642-31113-0
eBook Packages: Computer ScienceComputer Science (R0)