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

Cannot call map from Ramda with same arity but different signatures #101

Closed
rjmk opened this issue May 18, 2016 · 5 comments
Closed

Cannot call map from Ramda with same arity but different signatures #101

rjmk opened this issue May 18, 2016 · 5 comments

Comments

@rjmk
Copy link

rjmk commented May 18, 2016

The way the typings for map in Ramda currently work, if you try and call map in two places with the same arity (arguments passed one-by-one, or both at once), but different type arguments (array, object, functor), Flow will blow up.

For example, try adding

const zs: {[key: string]: string} = _.map((x) => x.toString(), { a: 1, b: 2, c: 3 })

below here

and running the tests

cc/ @alexeygolev

@alexeygolev
Copy link
Contributor

@rjmk will check tonight. Let me know if you have ideas about the possible reason

@rjmk
Copy link
Author

rjmk commented May 18, 2016

@alexeygolev I will do some research on Flow / the links on the inference algorithm you left on the PR. At the moment I'm pretty in the dark about all of this!

@alexeygolev
Copy link
Contributor

@rjmk by the way what do you mean by "flow will blow up"?

@alexeygolev
Copy link
Contributor

@rjmk can't reproduce or I'm not understanding the problem correctly. If I change the type of object values to number in your signature flow will complain which means it works the way it should. Your expression typechecks

@rjmk
Copy link
Author

rjmk commented May 18, 2016

@alexeygolev Sorry, horrendous of me not to paste the error output. My issue was that in the type checking error message, it would only consider the members of map with array types.

Now, however, I also cannot reproduce. But not could I reproduce when changing the type of object values to number. git diff shows only the insertion of that line. Upon deleting files ignored by the .gitignore the error disappears.

Appears to be anomalous. Sorry for dragging you into that, @alexeygolev

@rjmk rjmk closed this as completed May 18, 2016
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

No branches or pull requests

2 participants