robrix / path

A lambda calculus to explore type-directed program synthesis.
BSD 3-Clause "New" or "Revised" License
84 stars 2 forks source link

Nominal types #61

Open robrix opened 5 years ago

robrix commented 5 years ago

Path’s type system is closed—datatypes are treated as lambda encodings, and there are no mechanisms to extend the set of available types/values axiomatically. This means that its type system is essentially structural, rather than nominal.

This is a big part of why it’s difficult to pretty-print types nicely (cf #34); there’s nothing playing the role of a constructor (even in some erased form à la newtypes), so we have to embed neutral terms, force them during elaboration, and hope for the best.

It’d be nice to have something corresponding to a newtype which we could use to hang names on a lambda encoding, and other attendant features like typeclasses (cf #49). But it’s not immediately obvious how to do that in a consistently erasable manner, and ideally without opening the theory (i.e. introducing new axioms).