This program is tentative and subject to change.
In Haskell, accessing an object’s fields requires \textit{deconstructing} it. Thankfully, it is possible to name the fields of a data type using the \textit{record syntax}, allowing programmers to access objects’ fields using their name. This can help improve the readability of Haskell code. However, Haskell’s support for record types is limited, as its type system is nominal, and the language does not allow composing record types.
Previous work tackled this issue using type-level computations at compile time and linked lists at runtime. Since these approaches do not use native record data types, operations on such records (e.g. traversals) are consequently slower than on native data types.
In this paper, we leverage meta-programming and code generation to enable easy record composition and simulate structural subtyping, using \textit{type-transforming} functions and typeclasses generated at compile time. The resulting Haskell library, named \texttt{type-machine}, generates native record data types. Its API allows users to write their own functions to compose record types. Our approach does not require any compiler or runtime modifications.
Our benchmarks show that records generated by \texttt{type-machine} are at least 40% faster to traverse than records defined using state-of-the-art libraries. Additionally, simple programs that define data types using \texttt{type-machine} are at least 3x faster to compile than isomorphic programs that use these libraries.
We present use cases of the library along with examples of custom type transformers.
This program is tentative and subject to change.
Mon 29 JunDisplayed time zone: Brussels, Copenhagen, Madrid, Paris change
14:00 - 15:30 | |||
14:00 22mTalk | Programmable record types in Haskell GPCE | ||
14:22 22mTalk | Modular Substructural Constraints for Embedded DSLs GPCE Anna Herlihy EPFL, Amir Shaikhha University of Edinburgh, Anastasia Ailamaki EPFL, Martin Odersky EPFL | ||
14:45 22mTalk | Metis: A Compositional DSL for Board Games and Game Tree Search GPCE | ||
15:07 22mTalk | Synthesizing Recursive Functional Programs via Structure-Element Separation GPCE | ||