Skip to main content Accessibility help
×
Home
Hostname: page-component-55597f9d44-xbgml Total loading time: 0.62 Render date: 2022-08-15T16:07:27.389Z Has data issue: true Feature Flags: { "shouldUseShareProductTool": true, "shouldUseHypothesis": true, "isUnsiloEnabled": true, "useRatesEcommerce": false, "useNewApi": true } hasContentIssue true

Applicative programming with effects

Published online by Cambridge University Press:  01 January 2008

CONOR MCBRIDE
Affiliation:
University of Nottingham
ROSS PATERSON
Affiliation:
City University, London
Rights & Permissions[Opens in a new window]

Abstract

HTML view is not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

In this article, 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 article, introducing the applicative pattern by diverse examples, then abstracting it to define the Applicative type class and introducing a bracket notation that interprets the normal application syntax in the idiom of an Applicative functor. Furthermore, 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 Arrow.

Type
Functional Pearls
Copyright
Copyright © Cambridge University Press 2007

References

Baars, A., Löh, A. & Swierstra, S. D. (2004) Parsing permutation phrases. Journal of Functional Programming, 14 (6), 635646.CrossRefGoogle Scholar
Barr, M. & Wells, C. (1984) Toposes, Triples and Theories. Grundlehren der Mathematischen Wissenschaften, no. 278. New York:Springer, Chap. 9.Google Scholar
Coutts, D. (2002) Arrows for Errors: Extending the Error Monad. Unpublished presentation at the Summer School on Advanced Functional Programming.Google Scholar
Fridlender, D. & Indrika, M. (2000) Do we need dependent types? Journal of Functional Programming, 10 (4), 409415.CrossRefGoogle Scholar
Hughes, J. (2000) Generalising monads to arrows. Science of Computer Programming, 37 (1–3), 67111.CrossRefGoogle Scholar
Hutton, G. & Meijer, E. (1998) Monadic parsing in Haskell. Journal of Functional Programming, 8 (4), 437444.CrossRefGoogle Scholar
Leijen, D. & Meijer, E. (1999) Domain specific embedded compilers. 2nd Conference on Domain-Specific Languages (DSL). USENIX, Austin, TX, USA.Google Scholar
Meertens, L. (1998) Functor pulling. Workshop on Generic Programming (WGP'98). Marstrand, Sweden: Chalmers University of Technology.Google Scholar
Peyton Jones, S. (ed). (2003) Haskell 98 Language and Libraries: The Revised Report. Cambridge University Press.Google Scholar
Power, J. & Robinson, E. (1997) Premonoidal categories and notions of computation. Mathematical Structures in Computer Science, 7 (5), 453468.CrossRefGoogle Scholar
Röjemo, N. (1995) Garbage Collection and Memory Efficiency in Lazy Functional Languages. Ph.D. thesis, Chalmers University of Technology and Göteborg University.Google Scholar
Swierstra, S. D. & Duponcheel, L. (1996) Deterministic, error-correcting combinator parsers. Pages 184–207 of: Launchbury, J., Meijer, E. & Sheard, T. (eds), Advanced Functional Programming. LNCS, vol. 1129. Springer.Google Scholar
Wadler, P. (1985) How to replace failure by a list of successes. Pages 113–128 of: Jouannaud, J.-P. (ed), Functional Programming Languages and Computer Architecture. LNCS, vol. 201. Springer.Google Scholar
Submit a response

Discussions

No Discussions have been published for this article.
You have Access
213
Cited by

Save article to Kindle

To save this article to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Applicative programming with effects
Available formats
×

Save article to Dropbox

To save this article to your Dropbox account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you used this feature, you will be asked to authorise Cambridge Core to connect with your Dropbox account. Find out more about saving content to Dropbox.

Applicative programming with effects
Available formats
×

Save article to Google Drive

To save this article to your Google Drive account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you used this feature, you will be asked to authorise Cambridge Core to connect with your Google Drive account. Find out more about saving content to Google Drive.

Applicative programming with effects
Available formats
×
×

Reply to: Submit a response

Please enter your response.

Your details

Please enter a valid email address.

Conflicting interests

Do you have any conflicting interests? *