Applicative functor
In functional programming, specifically Haskell, an applicative functor is a structure that is like a monad (return
, fmap
, join
) without join
, or like a functor with return
. Applicative functors are the programming equivalent of strong lax monoidal functors in category theory. In Haskell, applicative functors are implemented in the Applicative
type class. Applicative functors were introduced in 2007 by Conor McBride and Ross Paterson in their paper Functional Pearl: applicative programming with effects.[1]
Relationship to monads
Due to historical accident, applicative functors were not implemented as a subclass of Functor
and not as a superclass of Monad
, but as a separate type class with no overlap. It turned out that in practice, there was very little demand for such a separation, so in 2014, it was proposed to make Applicative retroactively a subclass of Functor.[2]
See also
References
- ↑ Mcbride, Conor; Paterson, Ross (2008-01-01). "Applicative programming with effects". Journal of Functional Programming. 18 (01): 1–13. doi:10.1017/S0956796807006326. ISSN 1469-7653.
- ↑ "Functor-Applicative-Monad Proposal - HaskellWiki". wiki.haskell.org. Retrieved 2016-04-06.