Orchard, Dominic A., Mycroft, Alan (2012) A Notation for Comonads. Lecture Notes in Computer Science, . pp. 1-17. ISSN 0302-9743. (doi:10.1007/978-3-642-41582-1_1) (KAR id:57495)
PDF
Author's Accepted Manuscript
Language: English |
|
Download this file (PDF/375kB) |
Preview |
Request a format suitable for use with assistive technology e.g. a screenreader | |
Official URL: http://dx.doi.org/10.1007/978-3-642-41582-1_1 |
Abstract
The category-theoretic concept of a monad occurs widely as a design pattern for functional programming with effects. The utility and ubiquity of monads is such that some languages provide syntactic sugar for this pattern, further encouraging its use. We argue that comonads, the dual of monads, similarly provide a useful design pattern, capturing notions of context dependence. However, comonads remain relatively under-used compared to monads—due to a lack of knowledge of the design pattern along with the lack of accompanying simplifying syntax. We propose a lightweight syntax for comonads in Haskell, analogous to the do-notation for monads, and provide examples of its use. Via our notation, we also provide a tutorial on programming with comonads.
Item Type: | Article |
---|---|
DOI/Identification number: | 10.1007/978-3-642-41582-1_1 |
Divisions: | Divisions > Division of Computing, Engineering and Mathematical Sciences > School of Computing |
Depositing User: | Dominic Orchard |
Date Deposited: | 05 May 2017 13:39 UTC |
Last Modified: | 05 Nov 2024 10:47 UTC |
Resource URI: | https://kar.kent.ac.uk/id/eprint/57495 (The current URI for this page, for reference purposes) |
- Link to SensusAccess
- Export to:
- RefWorks
- EPrints3 XML
- BibTeX
- CSV
- Depositors only (login required):