How to type curried functions
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- developer-experience
Research direction
Start by reviewing the invocation examples and the proposed TypeScript overloads for curry and divide. Determine whether the omitted zero-argument and placeholder-only forms should remain untyped, and verify the decision against the repository's existing declarations and type-checking workflow.
Written by the indexing model from the issue text.
Description
ramda's curry function is awesome but also has abilities that are not strictly necessary to type
// all of these work!
R.divide(10, 2); // 5
R.divide()(10, 2); // 5
R.divide(R.__)(10, 2); // 5
The use cases for both R.divide() and R.divide(R.__) are however negligible
So when typing out, we're only going to type it as:
export function divide(a: number, b: number): number;
export function divide(__: Placeholder, b: number): (a: number) => number;
export function divide(a: number): (b: number) => number;
And leave out
export function divide(): (a: number, b: number) => number;
export function divide(__: Placeholder): (a: number, b: number) => number;
- Dominant language
- TypeScript
- Stars
- 31
- Forks
- 27
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ramda/types
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
`intersection` should return an array of the intersection of the types of each array's elementsOpen
Difficulty 3/5 1-2 days Newbie friendliness 65/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day