3 ms·
> You can think of booleans as a built-in, two-value enum that has a common semantic meaning. I love it when a language's bool type is just a sum-type like the
by frou_dh 2y ago
> You can think of booleans as a built-in, two-value enum that has a common semantic meaning.
I love it when a language's bool type is just a sum-type like the sum-types you define in user code, e.g. https://ocaml.org/manual/5.2/core.html#hevea_manual10 https://ocaml.org/manual/5.2/core.html#hevea_manual10. It's an indicator of a language with good foundations.
- xigoi 2y agoI agree. Nim’s booleans are an enum too: https://nim-lang.org/docs/system.html#bool https://nim-lang.org/docs/system.html#bool