Hostname: page-component-6766d58669-bp2c4 Total loading time: 0 Render date: 2026-05-16T16:53:36.279Z Has data issue: false hasContentIssue false

A representation theorem for second-order functionals

Published online by Cambridge University Press:  08 September 2015

MAURO JASKELIOFF
Affiliation:
CIFASIS, CONICET, Argentina, FCEIA, Universidad Nacional de Rosario, Argentina (e-mail: mauro@fceia.unr.edu.ar)
RUSSELL O'CONNOR
Affiliation:
Google Canada, Kitchener, Ontario, Canada (e-mail: oconnorr@google.com)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the 'Save PDF' action button.

Representation theorems relate seemingly complex objects to concrete, more tractable ones. In this paper, we take advantage of the abstraction power of category theory and provide a datatype-generic representation theorem. More precisely, we prove a representation theorem for a wide class of second-order functionals which are polymorphic over a class of functors. Types polymorphic over a class of functors are easily representable in languages such as Haskell, but are difficult to analyse and reason about. The concrete representation provided by the theorem is easier to analyse, but it might not be as convenient to implement. Therefore, depending on the task at hand, the change of representation may prove valuable in one direction or the other. We showcase the usefulness of the representation theorem with a range of examples. Concretely, we show how the representation theorem can be used to prove that traversable functors are finitary containers, how coalgebras of a parameterised store comonad relate to very well-behaved lenses, and how algebraic effects might be implemented in a functional language.

Information

Type
Articles
Creative Commons
Creative Common License - CCCreative Common License - BYCreative Common License - NCCreative Common License - SA
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (http://creativecommons.org/licenses/by/3.0/), which permits unrestricted re-use, distribution, and reproduction in any medium, provided the original work is properly cited.
Copyright
Copyright © Cambridge University Press 2015
Submit a response

Discussions

No Discussions have been published for this article.