Conversation

what *typed* languages have the best support for defining and working with multiple variations of an AST type, transforming between them, writing pattern-matching code for them in a DRY way, etc e.g. "take this function Expr -> Int and adapt it to Expr `Without` ExprLam inputs"
23
41
Replying to and
There's this common issue in inductive types where you want to add and remove stuff, and add extra data… and be able to reuse existing function implementations on these new types. Feel like this was partly what levitation and ornaments were trying to look at but I need to check.
1
4
AFAIK, ornaments seem about adding fields or indexes to existing datatypes — letting you relate, say, Peano naturals, lists (Peano naturals ornamented with elements), and vectors (lists ornamented with lengths). Levitation was a self-describing universe construction... OTOH:
2
1
Show replies