on master help sign in
Merge branch 'master' into boolean-op-fixity
commiteed742e2a383d281f6bea5575f9e6772971a50c6 authorAhmad Salim Al-Sibahi <asal@itu.dk> dateMon 23 Oct 2017, 13:06 (9 years ago) parentdcf65d8fddb326
5 files changed+5−2
CHANGELOG.md+1 libs/prelude/Prelude/Applicative.idr+1−1 src/IRTS/CodegenC.hs+1−1 test/bignum002/bignum002.idr+1 test/bignum002/expected+1
CHANGELOG.md+1
@@ -19,6 +19,7 @@
1919+ Added `discriminate` and `construct` tactics to Pruviloj.
2020+ Added `IsSucc` type to `Prelude`, which proves that a `Nat` is a successor.
2121+ Added `Data.IOArray`, containing primitives for mutable arrays.
22++ The operator `<|>` is now right-associative (it retains the same precedence).
2223+ Reworked operator fixity for `&&` and `||`, as well as the comparison operators: `==`, `/=`, `<`, `<=`, `>`, and `>=`.
2324
2425## Tool Updates
libs/prelude/Prelude/Applicative.idr+1−1
@@ -38,7 +38,7 @@ liftA2 f a b = (map f a) <*> b
3838liftA3 : Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d
3939liftA3 f a b c = (map f a) <*> b <*> c
4040
41−infixl 3 <|>
41+infixr 3 <|>
4242interface Applicative f => Alternative (f : Type -> Type) where
4343 empty : f a
4444 (<|>) : f a -> f a -> f a
src/IRTS/CodegenC.hs+1−1
@@ -179,7 +179,7 @@ bcc i (ASSIGNCONST l c)
179179 = indent i ++ creg l ++ " = " ++ mkConst c ++ ";\n"
180180 where
181181 mkConst (I i) = "MKINT(" ++ show i ++ ")"
182− mkConst (BI i) | i < (2^30) = "MKINT(" ++ show i ++ ")"
182+ mkConst (BI i) | i > ((-2)^30) && i < (2^30) = "MKINT(" ++ show i ++ ")"
183183 | otherwise = "MKBIGC(vm,\"" ++ show i ++ "\")"
184184 mkConst (Fl f) = "MKFLOAT(vm, " ++ (map toUpper $ show f) ++ ")"
185185 mkConst (Ch c) = "MKINT(" ++ show (fromEnum c) ++ ")"
test/bignum002/bignum002.idr+1
@@ -3,3 +3,4 @@ module Main
33main : IO ()
44main = do
55 putStrLn $ show $ divNat 1809022195644390369852458 91238741987
6+ putStrLn $ show $ div (-432642342742368327462378462387) 36473264372
test/bignum002/expected+1
@@ -1 +1,2 @@
1119827346982734
2+-11861903511836511836