3 ms·
That’s the reification of it in many langage but at its core what you really want if option is T | (). And some langages do express it that way though mostly fo
by masklinn 7y ago
That’s the reification of it in many langage but at its core what you really want if option is T | (). And some langages do express it that way though mostly for historical reasons of not having sum types and / or being dynamically typed (and there have been rumblings in the past of making rust enum variants into proper types).
Of course this is not the case for all enum types. But option / either / result, definitely.
- sullyj3 7y agoSure, namely typescript.