New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type inference example #136

Merged
merged 2 commits into from May 21, 2018

Conversation

Projects
None yet
3 participants
@phansch
Contributor

phansch commented May 21, 2018

This should make the chapter a bit more approachable, as it doesn't
start out with a reference to the HM type inference algorithm.

Add type inference example
This should make the chapter a bit more approachable, as it doesn't
start with a reference to the HM type inference algorithm.

@phansch phansch force-pushed the phansch:explain_type_inference branch from 61e45c4 to d3eb7ba May 21, 2018

@alexcameron89

As someone currently reading through the guide, I appreciate this addition.

I am curious, is there a reason for using inferenced over inferred? I thought that the latter was correct.

@phansch

This comment has been minimized.

Contributor

phansch commented May 21, 2018

Thanks! I'm doing the same right now to potentially fix rust-lang/rust#50548 at some point in the future :)

As for inferenced vs inferred, I'm not a native English speaker and inferenced seems to be used everywhere else in the guide.(Actually no)
There's some discussion on english.stackexchange.org which suggests that inferencing is used in linguistics, which could apply here as well, I guess. But I'm open to change it to inferred/inferring 👍

@alexcameron89

This comment has been minimized.

Contributor

alexcameron89 commented May 21, 2018

Oh very interesting, thanks for sharing!

@mark-i-m

Thanks!

Just a minor nit, then r=me.

Re: inferred vs inferenced: I think we can leave this as-is for now. If someone else comes along with more info later, we can revisit...

}
```
Here, `things` is *inferenced* to be `&str` because that's the value we push

This comment has been minimized.

@mark-i-m

mark-i-m May 21, 2018

Collaborator

Nit: "things is inferenced to be &str" -> "the type of things is ..."

@phansch phansch force-pushed the phansch:explain_type_inference branch from 08d7eb2 to 9ef4d04 May 21, 2018

@phansch

This comment has been minimized.

Contributor

phansch commented May 21, 2018

Fixed 👍

@mark-i-m

This comment has been minimized.

Collaborator

mark-i-m commented May 21, 2018

Thanks!

@mark-i-m mark-i-m merged commit 6315267 into rust-lang:master May 21, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@phansch phansch deleted the phansch:explain_type_inference branch May 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment