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

Remove unnecessary curried types #52

Closed
singla-shivam opened this issue Jun 19, 2022 · 0 comments · Fixed by #53
Closed

Remove unnecessary curried types #52

singla-shivam opened this issue Jun 19, 2022 · 0 comments · Fixed by #53
Assignees
Labels
types Refine/fix types

Comments

@singla-shivam
Copy link
Member

There are some functions which has unnecessary curried types

e.g function add has following types

type Add_2 = (b: number) => number

type Add_1 = (a: number) => number

type Add =
  & ((a: number, b?: PH) => Add_2)
  & ((a: PH, b: number) => Add_1)
  & ((a: number, b: number) => number)

Here, add takes two args of same type. Thus, calling add like add(3) or add(3, _) or add(_, 3) are equivalent. So we can remove such types from the definition. So final type will be-

type Add_2 = (b: number) => number

type Add =
  & ((a: number) => Add_2)
  & ((a: number, b: number) => number)
@singla-shivam singla-shivam added the types Refine/fix types label Jun 19, 2022
@singla-shivam singla-shivam self-assigned this Jun 19, 2022
singla-shivam added a commit that referenced this issue Jun 19, 2022
singla-shivam added a commit that referenced this issue Jun 19, 2022
singla-shivam added a commit that referenced this issue Jun 20, 2022
singla-shivam added a commit that referenced this issue Jun 21, 2022
singla-shivam added a commit that referenced this issue Jun 26, 2022
singla-shivam added a commit that referenced this issue Jun 26, 2022
singla-shivam added a commit that referenced this issue Jun 26, 2022
singla-shivam added a commit that referenced this issue Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
types Refine/fix types
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant