encyclopegia.org

Applicative functor

In functional programming, an applicative functor, or an applicative for short, is an intermediate structure between functors and monads.[src] 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).[src] In terms of category theory, applicative functors may be defined as lax monoidal functors with tensorial strength.[src] 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.[src] 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.[src] Applicative functors were introduced in 2008 by Conor McBride and Ross Paterson in their paper Applicative programming with effects.[src] 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#.[src] Glasgow Haskell, Idris, and F# offer language features designed to ease programming with applicative functors.[src] In Haskell, applicative functors are implemented in the Applicative type class.…[src]

In functional programming, an applicative functor, or an applicative for short, is an intermediate structure between functors and monads.[src] 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).[src] In terms of category theory, applicative functors may be defined as lax monoidal functors with tensorial strength.[src] 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.[src] 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.[src] Applicative functors were introduced in 2008 by Conor McBride and Ross Paterson in their paper Applicative programming with effects.[src] 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#.[src] Glasgow Haskell, Idris, and F# offer language features designed to ease programming with applicative functors.[src] In Haskell, applicative functors are implemented in the Applicative type class.[src] While in languages like Haskell monads are applicative functors, this is not always the case in general settings of category theory examples of monads which are not strong can be found on Math Overflow.[src] pure :: a -> f a and can be thought of as bringing values into the applicative.[src] The method for an applicative of type f has type ( ) :: f (a -> b) -> f a -> f b and can be thought of as the equivalent of function application inside the applicative.[src] Alternatively, instead of providing , one may provide a function called liftA2 .[src] These two functions may be defined in terms of each other; therefore only one is needed for a minimally complete definition.[src] Applicatives are also required to satisfy four equational laws: Identity: Composition: Homomorphism: Interchange: Every applicative is a functor.[src] To be explicit, given the methods pure and , fmap can be implemented as fmap g x = pure g x The commonly used notation is equivalent to .[src] instance Applicative Maybe where -- pure :: a -> Maybe a pure a = Just a -- ( ) :: Maybe (a -> b) -> Maybe a -> Maybe b Nothing _ = Nothing _ Nothing = Nothing (Just g) (Just x) = Just (g x) As stated in the Definition section, pure turns an a into a , and applies a Maybe function to a Maybe value.[src] Using the Maybe applicative for type a allows one to operate on values of type a with the error being handled automatically by the applicative machinery.[src] For example, to add and , one needs only write (+) m n For the non-error case, adding and gives .[src] If either of or is , then the result will be also.[src] This example also demonstrates how applicatives allow a sort of generalized function application.[src] ==References== ==External links== Description of the Applicative typeclass in the Haskell docs Definition of the Applicative typeclass in the Glasgow Haskell Prelude[src]

31 sentences · 31 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"Applicative functor." encyclopegia.org, 2026, https://encyclopegia.org/wiki/applicative-functor. Accessed 29 November 2026.

Chicago

"Applicative functor." encyclopegia.org. Accessed November 29, 2026. https://encyclopegia.org/wiki/applicative-functor.

APA

encyclopegia.org. (2026). Applicative functor. Retrieved November 29, 2026, from https://encyclopegia.org/wiki/applicative-functor

Accessed November 29, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

Functor

stub · references available

Ext functor

stub · references available

applicative computing systems

stub · references available

Applicative universal grammar

stub · references available

predicate functor logic

stub · references available

translation functor

stub · references available

Functor category

enwiki · references available

Derived functor

enwiki · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1371517530 · 0.5 · snapshot enwiki-001371517530

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools
  • Careers — open roles: frontier engineers and sales partners
  • Index — every corpus, paper and record
  • Estate guide — what a public data estate is
  • Founder — Lois-Kleinner Alpasan
  • Records — DOIs and external deposits
  • Documents — one-pagers, PDFs and QR codes
  • Brand kit — logos and share images
  • Papers — plain-language briefs with citations
  • Browser — search engine, PWA and bookmarklet
  • Anticloud — the operator and its projects

As seen in Business Insider · 336 outlets · evidence DOIs · plain-language papers

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.