Skip to content
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
Merged

Conversation

phansch
Copy link
Member

@phansch 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.

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

@alexcameron89 alexcameron89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member Author

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
Copy link
Contributor

Oh very interesting, thanks for sharing!

Copy link
Member

@mark-i-m mark-i-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@phansch
Copy link
Member Author

phansch commented May 21, 2018

Fixed 👍

@mark-i-m
Copy link
Member

Thanks!

@mark-i-m mark-i-m merged commit 6315267 into rust-lang:master May 21, 2018
@phansch phansch deleted the explain_type_inference branch May 22, 2018 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants