Hacker News new | ask | show | jobs
by rurban 1891 days ago
I fail to understand the importance of this article, why it's a shenigan. About every self respecting OO language honors and can infer return types (union or single), and follow properly the Liskov Substitution Principle (covariant returns, in opposite to args).

Next time another Rust fanboy will detect subtyping, and the strange behavior of different subtyping for return types. Inverse unification! Rust is special! Genius!

Liskov wrote that 1994.

1 comments

This is not about LSP but about Hindley-Milner. The return type influences the choice of function, not the other way around.

This is also not rust-specific. It is just someone learning how a new tool works, by pushing it to a boundary, then writing about the result. Both learning and sharing are a healthy reflex.

In the worst case, the author is one of today's lucky 10 000.Besides, the article made me realize an imperfection in my own understanding, so I am gratefull for having read it'