type inference gadts type families

Advanced type system features, such as GADTs, type classes, and type families have have proven to be invaluable language extensions for ensuring data invariants and program correctness among others. Unfortunately, they pose a tough problem for type inference, because they introduce local type assumptions.

In this article we present a novel constraint-based type inference approach for local type assumptions. Our system, called OutsideIn(X), is parameterised over the particular underlying constraint domain X, in the same way as HM(X). This stratification allows us to use a common metatheory and inference algorithm.

Going beyond the general framework, we also give a particular constraint solver for X = type classes GADTs type families, a non-trivial challenge in its own right.

Commenter

Lire maintenant ?

esquisses catégories adt spécifications

Category theory is more and more used in studying abstract data types. Since long time, some authors used the notion of sketch to study the syntax and semantics of mathematical structures. This notion, introduced and developed by Ehresmann, is more powerful than the signature one, since it uses limits in categorical sense. Indeed, the signature approach uses nothing but products, while the notion of sketch allows not only to specify algebraic structures but also non algebraic ones such as fields.

Un commentaire

Lire maintenant ?

categories adt

We show how to define fold operators for abstract data types. The main idea is to represent an ADT by a bialgebra, that is, an algebra/coalgebra pair with a common carrier. A program operating on an ADT is given by a mapping to another ADT. Such a mapping, called metamorphism, is basically a composition of the algebra of the second with the coalgebra of the first ADT. We investigate some properties of metamorphisms, and we show that the metamorphic programming style offers far-reaching opportunities for program optimization that cover and even extend those known for algebraic data types.

Un commentaire

Lire maintenant ?

poo adt introduction

In 1985 Luca Cardelli and Peter Wegner, my advisor, published an ACM Computing Surveys paper called “On understanding types, data abstraction, and polymorphism”. Their work kicked off a flood of research on semantics and type theory for object-oriented programming, which continues to this day. Despite 25 years of research, there is still widespread confusion about the two forms of data abstraction, abstract data types and objects. This essay attempts to explain the differences and also why the differences matter.

Un commentaire

Lire maintenant ?