Skip to main content

Constructing Applicative Functors

  • Conference paper
Mathematics of Program Construction (MPC 2012)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 7342))

Included in the following conference series:

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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)

    Chapter  Google Scholar 

  2. Atkey, R.: What is a categorical model of arrows? Electronic Notes on Theoretical Computer Science 229(5), 19–37 (2011)

    Article  Google Scholar 

  3. Baars, A.I., Löh, A., Doaitse Swierstra, S.: Parsing permutation phrases. Journal of Functional Programming 14(6), 635–646 (2004)

    Article  MATH  Google Scholar 

  4. Coutts, D.: Arrows for errors: Extending the error monad (2002); unpublished presentation at the Summer School on Advanced Functional Programming

    Google Scholar 

  5. 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)

    Google Scholar 

  6. Elliott, C.: Denotational design with type class morphisms. Technical Report 2009-01, LambdaPix (2009)

    Google Scholar 

  7. Hinze, R.: Type Fusion. In: Johnson, M., Pavlovic, D. (eds.) AMAST 2010. LNCS, vol. 6486, pp. 92–110. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  8. 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)

    Google Scholar 

  9. Hughes, J.: Generalising monads to arrows. Science of Computer Programming 37(1-3), 67–111 (2000)

    Article  MathSciNet  MATH  Google Scholar 

  10. Johann, P., Ghani, N.: A principled approach to programming with nested types in Haskell. Higher-Order and Symbolic Computation 22(2), 155–189 (2009)

    Article  Google Scholar 

  11. Kelly, G.M.: Basic concepts of enriched category theory. London Mathematical Society Lecture Note Series, vol. 64. Cambridge University Press (1982)

    Google Scholar 

  12. Lambek, J., Scott, P.J.: Introduction to Higher Order Categorical Logic. Cambridge Studies in Advanced Mathematics, vol. 7. Cambridge University Press, Cambridge (1986)

    MATH  Google Scholar 

  13. Lane, S.M.: Categories for the Working Mathematician. Springer, New York (1971)

    Book  MATH  Google Scholar 

  14. 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)

    Chapter  Google Scholar 

  15. McBride, C., Paterson, R.: Applicative programming with effects. Journal of Functional Programming 18(1), 1–13 (2008)

    Article  MATH  Google Scholar 

  16. Moggi, E.: Computational lambda-calculus and monads. In: Logic in Computer Science, pp. 14–23. IEEE Computer Society Press (1989)

    Google Scholar 

  17. Moggi, E.: An abstract view of programming languages. Technical Report ECS-LFCS-90-113, Laboratory for Foundations of Computer Science, University of Edinburgh (1990)

    Google Scholar 

  18. 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)

    Chapter  Google Scholar 

  19. 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)

    Chapter  Google Scholar 

  20. Wadler, P.: Comprehending monads. Mathematical Structures in Computer Science 2(4), 461–493 (1992)

    Article  MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics