Extensional equality preservation and verified generic programming. (21st October 2021)
- Record Type:
- Journal Article
- Title:
- Extensional equality preservation and verified generic programming. (21st October 2021)
- Main Title:
- Extensional equality preservation and verified generic programming
- Authors:
- BOTTA, NICOLA
BREDE, NURIA
JANSSON, PATRIK
RICHTER, TIM - Abstract:
- Abstract: In verified generic programming, one cannot exploit the structure of concrete data types but has to rely on well chosen sets of specifications or abstract data types (ADTs). Functors and monads are at the core of many applications of functional programming. This raises the question of what useful ADTs for verified functors and monads could look like. The functorial map of many important monads preserves extensional equality. For instance, if $$f, g \, : \, A \, \to \, B$$ are extensionally equal, that is, $$\forall x \in A$$, $$f \, x = g \, x$$, then $$map \, f \, : \, List \, A \to List \, B$$ and $$map \, g$$ are also extensionally equal. This suggests that preservation of extensional equality could be a useful principle in verified generic programming. We explore this possibility with a minimalist approach: we deal with (the lack of) extensional equality in Martin-Löf's intensional type theories without extending the theories or using full-fledged setoids. Perhaps surprisingly, this minimal approach turns out to be extremely useful. It allows one to derive simple generic proofs of monadic laws but also verified, generic results in dynamical systems and control theory. In turn, these results avoid tedious code duplication and ad-hoc proofs. Thus, our work is a contribution toward pragmatic, verified generic programming.
- Is Part Of:
- Journal of functional programming. Volume 31(2021)
- Journal:
- Journal of functional programming
- Issue:
- Volume 31(2021)
- Issue Display:
- Volume 31, Issue 2021 (2021)
- Year:
- 2021
- Volume:
- 31
- Issue:
- 2021
- Issue Sort Value:
- 2021-0031-2021-0000
- Page Start:
- Page End:
- Publication Date:
- 2021-10-21
- Subjects:
- Functional programming (Computer science) -- Periodicals
- Journal URLs:
- http://journals.cambridge.org/action/displayJournal?jid=JFP ↗
http://firstsearch.oclc.org ↗ - DOI:
- 10.1017/S0956796821000204 ↗
- Languages:
- English
- ISSNs:
- 0956-7968
- Deposit Type:
- Legaldeposit
- View Content:
- Available online (eLD content is only available in our Reading Rooms) ↗
- Physical Locations:
- British Library STI - ELD Digital store
- Ingest File:
- 19696.xml