3 ms·
In this particular case IMO it's bad because it essentially removes nominal typing for arguably no benefit. Even in Lean, a dependently typed language where re
by SkiFire13 2y ago
In this particular case IMO it's bad because it essentially removes nominal typing for arguably no benefit.
Even in Lean, a dependently typed language where recursors can be made explicit, people prefer using pattern matching instead of them. There is even sugar for transforming some recursors-like functions into pattern matching like syntax. FYI in Lean recursors are marked as non-computable due to performance concerns, so you can use them to write proofs but not programs.
Seen from yet another point of view, this is transforming inductive types in a function corresponding to a visitor. And yet functional programming folks spent years trying to convince people to replace visitors with proper inductive/algebraic data types and pattern matching, so this idea is a step backwards even for them.