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 integral number combinator #27

Merged
merged 2 commits into from
Sep 29, 2017
Merged

Conversation

ntreu14
Copy link
Contributor

@ntreu14 ntreu14 commented Sep 7, 2017

This PR aims to resolve issue #15.

valid <| validate (NumberThat [IsIntegral]) (JsonValue.Number -42M)
invalid <| validate (NumberThat [IsIntegral]) (JsonValue.Number 42.94M)
invalid <| validate (NumberThat [IsIntegral]) (JsonValue.Number -42.94M)
valid <| validate (NumberThat [IsIntegral]) (JsonValue.Float 0.0)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is interesting to note that a JsonValue.Number or JsonValue.Float ending with a .0 will validate.

I believe that this is reasonable because 42 = 42.0 mathematically speaking. I would love to hear your thoughts @mjgpy3.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's totally acceptable!

@mjgpy3 mjgpy3 merged commit cf025fb into master Sep 29, 2017
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.

2 participants