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

fix issue #83 and make sign function type more lenient #89

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stevezhee
Copy link

No description provided.

@stevezhee stevezhee closed this Nov 11, 2022
@stevezhee stevezhee reopened this Nov 11, 2022
@stevezhee
Copy link
Author

This commit changes the type of the sign function so that it matches the type of negate. Also removes some duplicate code.

Copy link
Collaborator

@RyanGlScott RyanGlScott left a comment

Choose a reason for hiding this comment

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

I have one suggestion below, but otherwise this looks reasonable.

@@ -706,7 +701,7 @@ integer' :: TokenParsing m => m Integer
integer' = int <?> "integer"
{-# INLINE integer' #-}

sign :: TokenParsing m => m (Integer -> Integer)
sign :: (TokenParsing m, Num a) => m (a -> a)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I understand the intent behind this, but it is a somewhat unforced change, as it's not required to fix #83. Moreover, the existing convention in this module is to use Integer everywhere, so I'd favor sticking to that convention.

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.

None yet

2 participants