Functional Pearl: Applicative programming with effects, Conor McBride and Ross Patterson
In this paper, we introduce Applicative functors—an abstract characterisation of an applicative style of effectful programming, weaker than Monads and hence more widespread. Indeed, it is the ubiquity of this programming pattern that drew us to the abstraction. We retrace our steps in this paper, introducing the applicative pattern by diverse examples, then abstracting it to deï¬ne the Applicative type class and introducing a bracket notation which interprets the normal application syntax in the idiom of an Applicative functor. Further, we develop the properties of applicative functors and the generic operations they support. We close by identifying the categorical structure of applicative functors and examining their relationship both with Monads and with Arrows.
A well written introduciton to a monad cousin, with a tantilizing hint that idioms are easier to introduce into Haskell syntax:
Given Haskell extended with multi-parameter type classes, enthusiasts for overloading may replace [[ and ]] by identiï¬ers iI and Ii with the right behaviour3.
3 Hint: Deï¬ne an overloaded function applicative u v1 . . . vn Ii = u (*) v1 ... (*) vn
Recent comments
36 weeks 1 day ago
36 weeks 1 day ago
36 weeks 1 day ago
1 year 6 weeks ago
1 year 10 weeks ago
1 year 12 weeks ago
1 year 12 weeks ago
1 year 14 weeks ago
1 year 19 weeks ago
1 year 19 weeks ago