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
23 weeks 1 day ago
23 weeks 1 day ago
23 weeks 1 day ago
45 weeks 3 days ago
49 weeks 4 days ago
51 weeks 2 days ago
51 weeks 2 days ago
1 year 1 week ago
1 year 6 weeks ago
1 year 6 weeks ago