Lesson plan

Applicative functor

In functional programming, an applicative functor, or an applicative for short, is an intermediate structure between functors and monads. Applicative functors allow for functorial computations to be sequenced (unlike plain functors), but don't allow using results from prior computations in the definition of subsequent ones (unlike monads). In terms of category theory, applicative functors may be defined as lax monoidal functors with tensorial strength. This may not be the most obvious categorification of the standard definition of applicative functor given below, but they are equivalent in the category of Haskell types. Note that the observation that all monads are applicative functors is specific to the category of Haskell types, and is not true in general with this categorical definition of applicative functor; monads in an arbitrary category need not preserve any monoidal product. Applicative functors were introduced in 2008 by Conor McBride and Ross Paterson in their paper Applicative programming with effects. Applicative functors first appeared as a library feature in Haskell, but have since spread to other languages such as Idris, Agda, OCaml, Scala, and F#. Glasgow Haskell, Idris, and F# offer language features designed to ease programming with applicative functors. In Haskell, applicative functors are implemented in the Applicative type class.…

Back to article

Article summary

In functional programming, an applicative functor, or an applicative for short, is an intermediate structure between functors and monads. Applicative functors allow for functorial computations to be sequenced (unlike plain functors), but don't allow using results from prior computations in the definition of subsequent ones (unlike monads). In terms of category theory, applicative functors may be defined as lax monoidal functors with tensorial strength. This may not be the most obvious categorification of the standard definition of applicative functor given below, but they are equivalent in the category of Haskell types. Note that the observation that all monads are applicative functors is specific to the category of Haskell types, and is not true in general with this categorical definition of applicative functor; monads in an arbitrary category need not preserve any monoidal product. Applicative functors were introduced in 2008 by Conor McBride and Ross Paterson in their paper Applicative programming with effects. Applicative functors first appeared as a library feature in Haskell, but have since spread to other languages such as Idris, Agda, OCaml, Scala, and F#. Glasgow Haskell, Idris, and F# offer language features designed to ease programming with applicative functors. In Haskell, applicative functors are implemented in the Applicative type class.…

Key claims

No claims recorded.

Discussion questions

  1. Summarise the article in your own words. Which single claim would you verify first, and why?
  2. Which claim in this article is most likely to be revised as the sources update? How would you check its current status?
  3. If two sources disagreed about one of these facts, what would you need in order to trust one over the other?

Bibliography

No sources recorded.

Key claims and bibliography are generated from the same tracked claims and sources as the article page.