Follow-up question.
Is there a way to “decomplete” a type without rebuilding every element?
Basically,
let decomplete : complete t -> incomplete t = fun x -> x
is technically valid, but obviously type-incorrect, so I have to write:
let decomplete ty =
match ty with
| Ptr t -> Ptr (decomplete t)
| Number -> Number
And that will allocate memory for no reason. Is there a way to write that easily?