-
Notifications
You must be signed in to change notification settings - Fork 64
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
Variants of R.map() and lost types #121
Comments
Thank you for posting. This is a variant of several other issues posted here, and comes down to currying/composition failing with functions using generics (yes, in Ramda that's almost all of them). I made a thread about this at TypeScript here. This is the primary problem for our repo right now, and I'd really like a solution for this as well. |
This still doesn't work with typescript@next (2.5.0-dev.20170615), which includes the TypeScript PRs:
Will this eventually work, or is there a problem with type inference because the types are "flowing from right to left"? Probably related: microsoft/TypeScript#15680 (comment) Versions: |
They didn't fix it, see microsoft/TypeScript#16072
|
I'm thinking the issue could potentially be worked around with given type level calls (microsoft/TypeScript#17961). Not working yet but at least that reduces those two issues to one. |
For the partial applied variants of
R.map()
the TypeScript compiler fails to infer/resolve the types of the parameter, e. g.elem
in the code example below.Here are the type declarations from
@types/ramda
:I quickly tried the declarations from the
master
branch. But they also didn't work.I guess there are some issues in this repository related to this problem. I also wonder, if there is an issue on Microsoft/TypeScript related to this.
The text was updated successfully, but these errors were encountered: