Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Data.Primitives.Views.divides behaves odd with negative dividend #4899

Open
1inguini opened this issue Feb 13, 2021 · 0 comments
Open

Data.Primitives.Views.divides behaves odd with negative dividend #4899

1inguini opened this issue Feb 13, 2021 · 0 comments

Comments

@1inguini
Copy link

Steps to Reproduce

module Issue

import Data.Primitives.Views

divTest : (Integer, Integer) -> (Integer,Integer)
divTest (x, y) with (divides x y)
  divTest (x, 0) | DivByZero = (x, 0)
  divTest (x@(y * _ + _), y) | DivBy _ = (x, y)

it : Issue.divTest <$> [(-13, 4), (-13, -4)] = [(-13, 4), (-13, -4)]
it = Refl

Expected Behavior

type check passes

Observed Behavior

   |
11 | it = Refl
   |      ~~~~
When checking right hand side of it with expected type
        divTest <$> [((-13), 4), ((-13), (-4))] = [((-13), 4), ((-13), (-4))]

Type mismatch between
        x = x (Type of Refl)
and
        [(-11, 4), (-11, -4)] = [(-13, 4), (-13, -4)] (Expected type)

Specifically:
        Type mismatch between
                -11
        and
                -13
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant