on master help sign in
Merge pull request #4253 from msmorgan/div-mod-precedence
77830c6Ahmad Salim Al-Sibahi
libs/prelude/Prelude/Interfaces.idr+2
@@ -12,6 +12,8 @@ infixl 7 <<, >> -- unused
12infixl 8 +, -
12infixl 8 +, -
13infixl 9 *, /
13infixl 9 *, /
14
14
15+infixl 9 `div`, `mod`
16+
15-- ------------------------------------------------------------- [ Boolean Ops ]
17-- ------------------------------------------------------------- [ Boolean Ops ]
16intToBool : Int -> Bool
18intToBool : Int -> Bool
17intToBool 0 = False
19intToBool 0 = False
test/views001/views001.idr+1−1
@@ -26,7 +26,7 @@ mergeSort xs with (splitRec xs)
26testList : Int -> Int -> List Int -> List Int
26testList : Int -> Int -> List Int -> List Int
27testList 0 seed acc = acc
27testList 0 seed acc = acc
28-- Need to explicitly mod since different back ends overflow differently
28-- Need to explicitly mod since different back ends overflow differently
29−testList x seed acc = let seed' = seed * 12345 + 768 `mod` 65536 in
29+testList x seed acc = let seed' = (seed * 12345 + 768) `mod` 65536 in
30 testList (x - 1) seed'
30 testList (x - 1) seed'
31 ((seed' `mod` 100) :: acc)
31 ((seed' `mod` 100) :: acc)
32
32
test/views001/views001a.idr+1−1
@@ -13,7 +13,7 @@ mergeSort xs with (splitRec xs)
13testList : Int -> Int -> List Int -> List Int
13testList : Int -> Int -> List Int -> List Int
14testList 0 seed acc = acc
14testList 0 seed acc = acc
15-- Need to explicitly mod since different back ends overflow differently
15-- Need to explicitly mod since different back ends overflow differently
16−testList x seed acc = let seed' = seed * 12345 + 768 `mod` 65536 in
16+testList x seed acc = let seed' = (seed * 12345 + 768) `mod` 65536 in
17 testList (x - 1) seed'
17 testList (x - 1) seed'
18 ((seed' `mod` 100) :: acc)
18 ((seed' `mod` 100) :: acc)
19
19
test/views002/views002.idr+1−1
@@ -11,7 +11,7 @@ qsort inp with (filtered (<) inp)
11testList : Int -> Int -> List Int -> List Int
11testList : Int -> Int -> List Int -> List Int
12testList 0 seed acc = acc
12testList 0 seed acc = acc
13-- Need to explicitly mod since different back ends overflow differently
13-- Need to explicitly mod since different back ends overflow differently
14−testList x seed acc = let seed' = seed * 12345 + 768 `mod` 65536 in
14+testList x seed acc = let seed' = (seed * 12345 + 768) `mod` 65536 in
15 testList (x - 1) seed'
15 testList (x - 1) seed'
16 ((seed' `mod` 100) :: acc)
16 ((seed' `mod` 100) :: acc)
17
17