3 ms·
What "functional programming features" does one need for useful optional types?
by detaro 7y ago
What "functional programming features" does one need for useful optional types?
- kibwen 7y agoPutting aside the "functional" bit, for a language to allow user-defined (i.e. not hardcoded into the language itself (which may not necessarily be a bad thing, but that's beside the point here)) optional types, you'd want the ability to say "this variable is either _this_ XOR _this_" (a.k.a. tagged unions/sum types/what Rust calls "enums"), and then in a statically-typed language you'd additionally want generics.