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

curried takeLast(N: number) on array gives "Types of parameters 'xs' and 'x' are incompatible." #312

Closed
joma74 opened this issue Nov 4, 2017 · 2 comments
Labels

Comments

@joma74
Copy link

joma74 commented Nov 4, 2017

First of all let me state that I am on the javascript side of source code, leveraging TS language service via VS Code and npm-ramda 0.25 over TS 2.6.1. Enjoying all of that, thank you for your great work.

This issue describes a situation for takeLast where takeLast is essentially curried before map by the usage of

map(takeLast(1), [[true, false], [true, false]])

Gives Types of parameters 'xs' and 'x' are incompatible. on my side. Venturing into npm-ramda index.d.ts i compared it's signature to that of take. Difference is the ordering of the ?overloaded last parameter?. Which i switched to

takeLast<T>(n: number): {
     (xs: string): string;
     (xs: T[]): T[];
};

Please note that i neither have an idea of why the change in ordering did have the right effect. Nor if that change is just a works-for-me.
Was determined to give that thing a share-back via pull request till i found that i have NO clue of what to change where (including testing) on your side of things, owing to my suboptimal level of understanding of typescript and even much less about the whereabouts of maintaining a typed definition for a functional JS library.
Last but not least take mercy on me if i did mix up terms describing this issue.

@joma74
Copy link
Author

joma74 commented Nov 4, 2017

Sorry, might got totally lost. But why is the header doc of @types/ramda/index.d.ts declaring https://github.com/donnut/typescript-ramda which finally takes me to this fine site?!?!

@ikatyang
Copy link
Member

ikatyang commented Nov 5, 2017

It seems you're using the types from DefinitelyTyped, which is a fork from this repo and maintained by DT these days, and we're trying to get sync with it (#191).

If you'd like to use types from this repo, you have to follow the steps from README.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants