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 -
Replying to @sgrif @andrew_mason1
Those unreadable errors come up when modifying the body of the function, not using it. So I often end up writing the return type anyway. Also, writing the return type helps me make sure I’m returning the right thing.
3 replies 0 retweets 1 like
Miss Dada 🏳️⚧️ Retweeted Miss Dada 🏳️⚧️
It's a great thing to be able to do, if you *know* the type of the thing you want to return. Often times it's not that simple.https://twitter.com/sgrif/status/937142589790158849 …
Miss Dada 🏳️⚧️ added,
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.