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

Add MagmaDiv for number #1845

Open
forno opened this issue Apr 19, 2023 · 0 comments
Open

Add MagmaDiv for number #1845

forno opened this issue Apr 19, 2023 · 0 comments

Comments

@forno
Copy link
Contributor

forno commented Apr 19, 2023

🚀 Feature request

Current Behavior

number.ts has only add, mul or sub.

Desired Behavior

Add MagmaDiv to number.ts

Suggested Solution

export const MagmaDiv = {
  concat: (lhs: number, rhs: number): number => lhs / rhs
}

Javascript's division will return Number.INFINITY or Number.NEGATIVE_INFINITY on if rhs are 0.
It is good for Magma's condition.

Who does this impact? Who is this for?

For strict functional programming users.

Describe alternatives you've considered

Some one think so Number.INFINITY aren't "number".
Then, the division has no Magma.

Additional context

number are basic type.
I want add, sub, mul or div instances for number.

Your environment

Software Version(s)
fp-ts 2.13.1
TypeScript 5.0.4
@gcanti gcanti modified the milestones: 2.14, 2.15 Apr 19, 2023
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