3 ms·
Interesting, is there a formal name for this kind of type system that has the ability to look at the code paths and express disjoint type sets? Is this a trend
by bogomipz 10y ago
Interesting, is there a formal name for this kind of type system that has the ability to look at the code paths and express disjoint type sets?
Is this a trend in newer languages in general or an FP specific thing?
- airless_bar 10y ago> formal name non-shitty > a trend in newer languages yes, only discovered a few decades ago :-D
- bogomipz 10y agoI understand making a snarky comment in addition to some meaningful commentary but really two useless comments? Why even take the time to do so?
- airless_bar 10y agoSorry, was meant to be a light-hearted response.
- zaphar 10y agoTypically it's referred to as an Algebraic Data Type https://en.wikipedia.org/wiki/Algebraic_data_type https://en.wikipedia.org/wiki/Algebraic_data_type. Any Type System that can express this type will be able to do the above. It's not necessarily new since the ML family of languages has had it for a while now. It's also not limited to FP languages but it best known from ML the ML family. Rust has it though as well as Swift i think.
- bogomipz 10y agoI see. Thank you for the follow up. This is really helpful. Haskell implements this data type which is why it has come up in this discussion. I need to spend some time with something from the ML family.