3 ms·
They pain of "unexpected any" they have doesn't come just from the type inference, but from gradual typing that makes it "too much". Without unknown/any being a
by pornel 7y ago
They pain of "unexpected any" they have doesn't come just from the type inference, but from gradual typing that makes it "too much". Without unknown/any being allowed to spread everywhere, the inference would have failed sooner, and the error/confusion would be contained (e.g. Rust stops on an ambiguous method call, plus limits implicit inference to function boundaries).
- klodolph 7y agoI feel this is a lesson every Haskell programmer goes through. Most Haskell programmers I know write types for all of the top-level declarations. Although it usually isn't necessary, it makes drastic improvements to the quality of error messages.
- rkangel 7y ago> Although it usually isn't necessary, it makes drastic improvements to the quality of error messages. It also provides valuable documentation. You can usually work out what a function does from just its type (and quite often, that's all you have to work with).
- papln 7y ago> just its type (and quite often, that's all you have to work with). which is a weakness in the culture of Haskell library authors and/or the ecosystem for contributing documentation patches.
- rkangel 7y agoCouldn't agree more. My recent experiences with Rust and especially Elixir have set high standards.