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

Additional cases for <=? type family #4

Closed
RobMurray98 opened this issue Mar 7, 2019 · 3 comments
Closed

Additional cases for <=? type family #4

RobMurray98 opened this issue Mar 7, 2019 · 3 comments

Comments

@RobMurray98
Copy link
Contributor

Was surprised to find that the following type doesn't reduce to a boolean:
Pos 1 <=? Pos 2

The <=? type family seems to be missing cases like this for positive integers. The following definitions should be added to the <=? type family in Data.TypeNums.Comparison:

type family (a :: k1) <=? (b :: k2) :: Bool where
    ...
    (Pos a) <=? (Pos b) = (G.<=?) a b
    (Pos _) <=? (Neg _) = False 

Those are the missing cases that I've identified, there may be more.

@adituv
Copy link
Owner

adituv commented Mar 7, 2019

You're absolutely correct. I believe the Pos constructor didn't exist when I originally created that type family and it being missing is an oversight. Would you like to submit a pull request for this?

@RobMurray98
Copy link
Contributor Author

Will do later :)

@adituv
Copy link
Owner

adituv commented Mar 19, 2021

Closed: PR has been manually merged, even if GitHub doesn't realise it.

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