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

Don't shadow type variables #35

Merged
merged 1 commit into from
Nov 20, 2015
Merged

Don't shadow type variables #35

merged 1 commit into from
Nov 20, 2015

Conversation

tfausak
Copy link
Contributor

@tfausak tfausak commented Nov 20, 2015

The PureScript compiler warns about shadowed type variables as of 0.7.6.

readElements arr = sequence (zipWith readElement (range zero (length arr)) arr)

readElement :: forall a. (IsForeign a) => Int -> Foreign -> F a
readElement :: forall b. (IsForeign b) => Int -> Foreign -> F b
Copy link
Member

Choose a reason for hiding this comment

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

I think we can rely on scoped type variables here instead:

readElement :: Int -> Foreign -> F a

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, good point. I mechanically transformed the type signature and didn't realize what it was doing.

The PureScript compiler warns about shadowed type variables as of 0.7.6.
@tfausak
Copy link
Contributor Author

tfausak commented Nov 20, 2015

Updated!

@garyb
Copy link
Member

garyb commented Nov 20, 2015

Another stupid error I'll fix after merge. Thanks!

garyb added a commit that referenced this pull request Nov 20, 2015
Don't shadow type variables
@garyb garyb merged commit f3825cd into purescript:master Nov 20, 2015
@tfausak tfausak deleted the patch-1 branch November 20, 2015 01:15
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.

2 participants