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
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
The “expression problem” is about adding constructors and extending programs. Meanwhile in the wild, having types for each constructors, and combining them using OO (union types/market traits), seems somewhat popular in the wild (in Scala, and possibly in TypeScript).
1