If Rust had return type inference, it would be close to my ideal language
-
-
Replying to @sgrif
Do you mean what other languages call the unit type? Or something else?
1 reply 0 retweets 0 likes -
Replying to @andrew_mason1 @sgrif
No. He means omitting the return type of a function and letting the compiler figure that out itself. (I’m not a fan of it.)
1 reply 0 retweets 0 likes -
Replying to @noop_noob @sgrif
Oh god this is embarrassing. I read that as "return type interface" not "inference"
1 reply 0 retweets 1 like -
Curious, though. That's one thing I like about Haskell; why are you not a fan?
1 reply 0 retweets 0 likes -
Replying to @andrew_mason1 @sgrif
Unreadable type errors. And I like seeing the types without having to use some tool for it.
2 replies 0 retweets 2 likes -
Replying to @noop_noob @andrew_mason1
That sounds like more of an argument against a poor implementation of return type inference than an argument against return type inference. The type error should be identical to what would be there if you wrote the type explicitly.
3 replies 0 retweets 2 likes -
Inference is often bound to make some errors worse, since some errors will move to use site or to later calls. But tool support to autocomplete the return type would probably be a nice compromise.
1 reply 0 retweets 1 like
Return type inference does not imply making type inference program-wide
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.