4 ms·
It is not crucial for functional programming, unless your functional programming language uses types as variant tags. Both Haskell and OCaml use type erasure,
by wtetzner 10y ago
It is not crucial for functional programming, unless your functional programming language uses types as variant tags.
Both Haskell and OCaml use type erasure, and I doubt anyone would claim they aren't functional languages.
- danarmak 10y agoIf they store a variant tag, that means they don't erase the bit of info that's needed for case matching. My point is that it's crucial to be able to tell at runtime to which (sub)type a value belongs. Other type information that isn't necessary for that can still be erased.
- wtetzner 10y agoI think we're in agreement, and just tripping over terminology. In most functional languages, values in a variant are just values in that variant. They don't each have their own type, which means the variant tag isn't actually type information.