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

feat: added G.isFinite, G.isInfinite #109

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

JUSTIVE
Copy link
Sponsor

@JUSTIVE JUSTIVE commented Mar 10, 2024

resolves #108

@JUSTIVE
Copy link
Sponsor Author

JUSTIVE commented Mar 10, 2024

Attempted with rescript with gentype, but Js.Float.isFinite turned into $$isFinite. I'm not sure why, so currently it's implemented with js and type definitions. if anyone knows reason why, please let me know.

@JUSTIVE
Copy link
Sponsor Author

JUSTIVE commented Mar 11, 2024

https://forum.rescript-lang.org/t/prefix-from-build-output/5115/2?u=justive

$$ appeared because of the ambiguity of the isFinite, which is globally available on the js side.

@weltmx
Copy link

weltmx commented Mar 11, 2024

@JUSTIVE Hey, thanks for the PR :). Looking at the typing maybe replicating the isNumber type would be more practical, since Number.isFinite is typed isFinite(number: unknown) by default, we would just extend it with a type predicate.

export declare function isFinite<A>(
  value: A | number,
): value is Guard<A, number>

Edit: @JUSTIVE Also I don't know how likely these PR are to be merged, seeing how many are racking up and staying open. The last merge seems to date back to 2022.

@JUSTIVE
Copy link
Sponsor Author

JUSTIVE commented Mar 11, 2024

I'm also not sure when @mobily will be back, but I believe he will, as he said on #93.
As a daily ts-belt user, I really love this library, and hope to keep maintained.

just updated the type as you said, thanks for the reply.

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

Successfully merging this pull request may close these issues.

Proposal: G.isFinite
2 participants