News for hackers. Stuff that matters.
Re:Weird Expressions in Rust by GrantMoyer on Friday June 27, 2025 @04:54PM (#44400138)
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

[2]: https://en.wikipedia.org/wiki/Bottom_type

Re:Weird Expressions in Rust by dmkolobov on Friday June 27, 2025 @08:27PM (#44401478)
On the more mainstream side of things, Typescript also has a bottom type called `never` which is used to type unreachable/exceptional code.
Re:Weird Expressions in Rust by saghm on Saturday June 28, 2025 @02:37AM (#44402701)