7 ms·
Haskell has `bottom`[1] (see also [2]), which acts like Rust's `return` from a type checking perspective. I wouldn't call using a uninhabited type for the type
by GrantMoyer 1y ago
Haskell has `bottom`[1] (see also [2]), which acts like Rust's `return` from a type checking perspective.
I wouldn't call using a uninhabited type for the type of a return expression theoretically inelegant. On the contrary, I find it quite pleasing.
[1]: https://wiki.haskell.org/Bottom https://wiki.haskell.org/Bottom
[2]: https://en.wikipedia.org/wiki/Bottom_type https://en.wikipedia.org/wiki/Bottom_type