Work

Objects to Unify Type Classes and GADTs

Year: 2008
Type: other
Abstract: We propose an Haskell-like language with the goal of unifying type classes and generalized algebraic datatypes (GADTs) into a single class construct. We treat classes as first-class types and we use objects (instead of type class instances and data constructors) to define the values of those classes. We recover the ability to define functions by pattern matching by using sealed classes. The resulting language is simple and intuitive and it can be used to define, with similar convenience, the same programs that we would define in Haskell. Furthermore, unlike Haskell, dictionaries (or objects) can be explicitly (as well as implicitly) passed to functions and we can program in a simple object-oriented style directly. 1.
Language: English
Subfield: Software
Open Access status: green
OpenAlex ID: W1506921086
Cites: 18
Cited by: 7
Related to: 10