# Data types à la carte

@article{Swierstra2008DataT, title={Data types {\`a} la carte}, author={Wouter Swierstra}, journal={Journal of Functional Programming}, year={2008}, volume={18}, pages={423 - 436} }

Abstract This paper describes a technique for assembling both data types and functions from isolated individual components. We also explore how the same technology can be used to combine free monads and, as a result, structure Haskell's monolithic IO monad.

## 243 Citations

A generic abstract syntax model for embedded languages

- Computer Science
- 2012

Representing a syntax tree using a data type often involves having many similar-looking constructors. Functions operating on such types often end up having many similar-looking cases. Different lan...

Trees that Grow

- Computer ScienceJ. Univers. Comput. Sci.
- 2017

A programming idiom that exploits type-level functions to allow a particular form of extensibility in functional data types is described, which scales to support existentials and generalised algebraic data types.

Integration of a Decentralised Pattern Matching

- Computer Science
- 2017

A new technique for pattern matching that is based on components for each match that gives rise to a solution to the Expression Problem in presence of defaults.

Generic storage in Haskell

- Computer ScienceWGP '10
- 2010

A framework for constructing functional data structures that can be stored on disk based on expressing datatypes as fixed points of functors and then annotating the recursive positions with additional information is presented.

Composing and decomposing data types: a closed type families implementation of data types à la carte

- Computer ScienceWGP '14
- 2014

This work refined the subtyping constraint, which is at the centre of data types à la carte, and derived a new constraint to express type isomorphism, which allows for more flexibility in composing and decomposing data types.

Generic Programming with Combinators and Objects

- Computer ScienceScientific and Technical Journal of Information Technologies, Mechanics and Optics
- 2021

A generic programming framework for OCAML which makes it possible to implement extensible transformations for a large scale of type definitions by utilising late binding to override the default behaviour of generated transformations.

Foundations of Implicit Function Types

- Computer Science
- 2017

A generalization of implicit parameters as they are currently found in Scala to implicit function types is described and formal foundations that closely follow the semantics implemented by the Scala compiler are provided.

Programación Funcional y Herencia de Clases: Tipos de Datos Algebraicos Extensibles en Scala

- Computer Science
- 2014

class Term{ def eval(): Int

Unifying Analysis Tools with Rosetta

- Computer Science2008 23rd IEEE/ACM International Conference on Automated Software Engineering
- 2008

A semi-automated tool will generated tool-specific analysis models and a correspondence with the original Rosetta specifications, to leverage the existing analysis tools and create an analysis environment unified around the Rosetta language.

The monad zipper

- Computer Science
- 2010

This pearl demonstrates that Functional Programming’s abstractions are up to the challenge and must be followed by clever instantiation: Huet's zipper for the monad stack makes components jump through unanticipated hoops.

## References

SHOWING 1-10 OF 16 REFERENCES

Generic unification via two-level types and parameterized modules

- Computer ScienceICFP '01
- 2001

This work describes an efficient, modularized implementation of unification using the state of mutable referencecells to encode substitutions and the use of rank-2 polymorphism inside Haskell's record types to implement a form of typeparameterized modules.

Open data types and open functions

- Computer SciencePPDP '06
- 2006

This work presents a semantically and syntactically lightweight variant of open data types and open functions as a solution to the expression problem in the Haskell language and shows that the solution is applicable to theexpression problem, generic programming, and exceptions.

Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire

- MathematicsFPCA
- 1991

A calculus for lazy functional programming based on recursion operators associated with data type definitions is developed and it is shown that all example functions in Bird and Wadler's Introduction to Functional Programming can be expressed using these operators.

Beauty in the beast

- Computer ScienceHaskell '07
- 2007

This work provides a functional specification of three central components of Peyton Jones's awkward squad: teletype IO, mutable state, and concurrency, and demonstrates how these specifications may be used in tandem with QuickCheck to automatically test complex pointer algorithms and concurrent programs.

Monad transformers and modular interpreters

- Computer SciencePOPL '95
- 1995

A fully modular interpreter based on monad transformers that incudes features missing from Steele's, Espinosa's, and Wadler's earlier efforts is designed and implemented in Gofer, whose constructor classes provide just the added power over Haskell's type classes to allow precise and convenient expression of the ideas.

Beauty in the Beast A Functional Semantics for the Awkward Squad

- Computer Science
- 2007

This work provides a functional specification of three central components of Peyton Jones’s awkward squad: teletype IO, mutable state, and concurrency, and demonstrates how these specifications may be used in tandem with QuickCheck to automatically test complex pointer algorithms and concurrent programs.

Initial Algebra Semantics Is Enough!

- Computer ScienceTLCA
- 2007

It has long been thought that initial algebra semantics is not expressive enough to provide a similar foundation for programming with nested types, but this paper overturns this conventional wisdom by solving all of these problems.

Foundations for structured programming with GADTs

- Computer SciencePOPL '08
- 2008

The standard theory of data types as carriers of initial algebras of functors can be extended from algebraic and nested data types to GADTs, and a constructive demonstration that every GADT can be reduced to one which uses only the equality GADt and existential quantification is given.

Composing monads using coproducts

- Computer ScienceICFP '02
- 2002

It is proposed that two monads should be composed by taking their coproduct, a simple idea which is general in that nearly all monads compose, mathematically elegant in using the standard categorical tools underpinning monads and computationally expressive in supporting a canonical recursion operator.

Category Theory

- Mathematics
- 2006

Category theory is a branch of abstract algebra with incredibly diverse applications. This text and reference book is aimed not only at mathematicians, but also researchers and students of computer…