Data types à la carte (2008)

Lobsters Hottest Papers

Summary

This paper presents a technique for composing data types and functions from independent components, and extends the approach to combine free monads, enabling a modular structuring of Haskell's IO monad.

<p><a href="https://lobste.rs/s/8ukphx/data_types_la_carte_2008">Comments</a></p>
Original Article
View Cached Full Text

Cached at: 05/31/26, 02:14 AM

# Data types à la carte | Journal of Functional Programming | Cambridge Core Source: [https://www.cambridge.org/core/journals/journal-of-functional-programming/article/data-types-a-la-carte/14416CB20C4637164EA9F77097909409](https://www.cambridge.org/core/journals/journal-of-functional-programming/article/data-types-a-la-carte/14416CB20C4637164EA9F77097909409) ## 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\. 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\. ## References Awodey,S\.\(2006\)Category Theory\.Oxford Logic Guides, vol\. 49\.Oxford:Oxford University Press\.[CrossRef](https://dx.doi.org/10.1093/acprof:oso/9780198568612.001.0001)[Google Scholar](https://scholar.google.com/scholar_lookup?title=Category+Theory.&author=Awodey+S.&publication+year=2006) Johann,P\.&Ghani,N\.\(2007\) Initial algebra semantics is enough\!*Typed Lambda Calculi and Applications*\. Lecture Notes in Computer Science, vol\. 4583\. Springer\.[CrossRef](https://dx.doi.org/10.1007/978-3-540-73228-0_16)[Google Scholar](https://scholar.google.com/scholar?q=Johann,+P.+&+Ghani,+N.+(2007)+Initial+algebra+semantics+is+enough!+Typed+Lambda+Calculi+and+Applications.+Lecture+Notes+in+Computer+Science,+vol.+4583.+Springer.) Johann,P\.&Ghani,N\.\(2008\) Foundations for structured programming with GADTs\. InConference record of the ACM SIGPLAN\-SIGACT Symposium on Principles of Programming Languages\.San Francisco, California, pp\.297–308\.[Google Scholar](https://scholar.google.com/scholar_lookup?title=Conference+record+of+the+ACM+SIGPLAN-SIGACT+Symposium+on+Principles+of+Programming+Languages&author=Johann+P.&author=Ghani+N.&publication+year=2008&pages=297-308) Liang,S\.,Hudak,P\.&Jones,M\.\(1995\) Monad transformers and modular interpreters\. InConference record of the ACM SIGPLAN\-SIGACT Symposium on Principles of Programming Languages\.San Francisco, California, pp\.333–343\.[Google Scholar](https://scholar.google.com/scholar_lookup?title=Conference+record+of+the+ACM+SIGPLAN-SIGACT+Symposium+on+Principles+of+Programming+Languages&author=Liang+S.&author=Hudak+P.&author=Jones+M.&publication+year=1995&pages=333-343) Löh,A\.&Hinze,R\.\(2006\) Open data types and open functions\.*Princ\. Prac\. Declarative Program\. Proceedings of the 8th ACM SIGPLAN Symposium on Principles and Practice of Declarative Programming*\. Venice, Italy, pp\. 133–144\.[CrossRef](https://dx.doi.org/10.1145/1140335.1140352)[Google Scholar](https://scholar.google.com/scholar?q=L%C3%B6h,+A.+&+Hinze,+R.+(2006)+Open+data+types+and+open+functions.+Princ.+Prac.+Declarative+Program.+Proceedings+of+the+8th+ACM+SIGPLAN+Symposium+on+Principles+and+Practice+of+Declarative+Programming.+Venice,+Italy,+pp.+133%E2%80%93144.) Lüth,C\.&Ghani,N\.\(2002\) Composing monads using coproducts\. In*Proceedings of the ACM SIGPLAN International Conference on Functional Programming*\. Pittsburgh, PA, pp\. 133–144\.[CrossRef](https://dx.doi.org/10.1145/581478.581492)[Google Scholar](https://scholar.google.com/scholar?q=L%C3%BCth,+C.+&+Ghani,+N.+(2002)+Composing+monads+using+coproducts.+In+Proceedings+of+the+ACM+SIGPLAN+International+Conference+on+Functional+Programming.+Pittsburgh,+PA,+pp.+133%E2%80%93144.) Meijer,E\.,Fokkinga,M\.&Paterson,R\.\(1991\) Functional programming with bananas, lenses, envelopes and barbed wire\. In*Proceedings ACM Conference on Functional Programming Languages and Computer Architecture*\.[CrossRef](https://dx.doi.org/10.1007/3540543961_7)[Google Scholar](https://scholar.google.com/scholar?q=Meijer,+E.,+Fokkinga,+M.+&+Paterson,+R.+(1991)+Functional+programming+with+bananas,+lenses,+envelopes+and+barbed+wire.+In+Proceedings+ACM+Conference+on+Functional+Programming+Languages+and+Computer+Architecture.) Sheard,T\.\(2001\) Generic unification via two\-level types and parameterized modules\. In*Proceedings of the ACM SIGPLAN International Conference on Functional Programming*\. Florence, Italy, pp\. 86–97\.[Google Scholar](https://scholar.google.com/scholar?q=Sheard,+T.+(2001)+Generic+unification+via+two-level+types+and+parameterized+modules.+In+Proceedings+of+the+ACM+SIGPLAN+International+Conference+on+Functional+Programming.+Florence,+Italy,+pp.+86%E2%80%9397.) Swierstra,W\.&Altenkirch,T\.\(2007\) Beauty in the beast: A functional semantics of the awkward squad\. In*Proceedings of the ACM SIGPLAN Haskell Workshop*\. Freiburg, Germany, pp\. 25–36\.[CrossRef](https://dx.doi.org/10.1145/1291201.1291206)[Google Scholar](https://scholar.google.com/scholar?q=Swierstra,+W.+&+Altenkirch,+T.+(2007)+Beauty+in+the+beast:+A+functional+semantics+of+the+awkward+squad.+In+Proceedings+of+the+ACM+SIGPLAN+Haskell+Workshop.+Freiburg,+Germany,+pp.+25%E2%80%9336.)

Similar Articles

Data-directed programming in Haskell (SICP2.4.3)

Lobsters Hottest

This article demonstrates implementing data-directed programming in Haskell for complex number operations, following the approach from SICP 2.4.3 to avoid modifying generic functions when adding new representations.

Profunctor Equipment in Haskell

Hacker News Top

This blog post provides a toy Haskell implementation of profunctor equipment, including natural transformations and composition, to make category-theoretic concepts accessible to programmers.

Mechanized type inference for record concatenation

Lobsters Hottest

This post mechanizes Mitchell Wand's 1991 type inference algorithm for biased record concatenation, providing declarative and algorithmic semantics and a Haskell reference implementation to advance type checking for Nix and other languages.

Type Inference (Part 1)

Lobsters Hottest

A tutorial on type inference covering the Damas-Hindley-Milner type system, unification, and related concepts, with OCaml code examples.

Record type inference for dummies

Lobsters Hottest

The article explains the basics of type inference for anonymous records in statically typed languages, using type theory notation and Haskell as the implementation language.