Author:
JASKELIOFF MAURO,O'CONNOR RUSSELL
Abstract
AbstractRepresentation 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.
Publisher
Cambridge University Press (CUP)
Reference30 articles.
1. Categories for the Working Mathematician
2. Van Laarhoven T. 2009c (Apr.) Where Do I Get My Non-Regular Types? Available at: http://twanvl.nl/blog/haskell/non-regular2.
3. On Monadic Parametricity of Second-Order Functionals
4. Gibbons J. & Johnson M. (2012) Relating algebraic and coalgebraic descriptions of lenses. 49 (Bidirectional Transformations 2012). Berlin, Germany.
5. Category Theory
Cited by
10 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献