4 ms·
Is the match-case statement a functional concept? I see it in functional languages but I'm not sure it is inherently functional...
by rirze 3y ago
Is the match-case statement a functional concept? I see it in functional languages but I'm not sure it is inherently functional...
- agumonkey 3y agofunctional I can't say, but match was highly related to structural typing which was very much central in FP/LP culture
- FrustratedMonky 3y agoThink this is answer. It isn't technically needed to be called 'functional', but it is so integral to type systems that it seems to be used in all functional languages. Maybe we can call 'match' statements an emergent phenomena of functional languages.
- agumonkey 3y agoand i'm sure the idea floated around in non FP languages too, but 1) mutable programming shifts the idioms very very far away from passive destructuring, they like to deref pointers and reuse memory cells 2) it's also linked to parametric type systems I believe, which was missing until cpp/java5 in the mainstream (while FP had this since milner which was in the 70s)