Skip to content

Commit ce4614c

Browse files
committed
Updates for PureScript 0.11
1 parent a84ea59 commit ce4614c

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

bower.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
"package.json"
2121
],
2222
"dependencies": {
23-
"purescript-maybe": "^2.0.0"
23+
"purescript-maybe": "^3.0.0"
2424
},
2525
"devDependencies": {
26-
"purescript-integers": "^2.0.0",
27-
"purescript-console": "^2.0.0",
28-
"purescript-assert": "^2.0.0",
29-
"purescript-quickcheck": "^3.0.0"
26+
"purescript-integers": "^3.0.0",
27+
"purescript-console": "^3.0.0",
28+
"purescript-assert": "^3.0.0",
29+
"purescript-quickcheck": "^4.0.0"
3030
}
3131
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"build": "pulp test && rimraf docs && pulp docs"
55
},
66
"dependencies": {
7-
"big-integer": "^1.6.9"
7+
"big-integer": "^1.6.17"
88
},
99
"devDependencies": {
1010
"pulp": "^9.0.0",

src/Data/BigInt.purs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import Prelude
1818
import Data.Maybe (Maybe(..))
1919

2020
-- | An arbitrary length integer.
21-
foreign import data BigInt :: *
21+
foreign import data BigInt :: Type
2222

2323
-- | FFI wrapper to parse a String in a given base representation into a BigInt.
2424
foreign import fromBase' :: forall a. (a -> Maybe a)

test/Main.purs

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import Data.BigInt (BigInt, abs, fromInt, prime, pow, odd, even, fromString,
88
toNumber, fromBase, toString)
99
import Data.Foldable (fold)
1010
import Data.Maybe (Maybe(..), fromMaybe)
11+
import Data.NonEmpty ((:|))
1112
import Test.Assert (ASSERT, assert)
1213
import Control.Monad.Eff.Random (RANDOM())
1314
import Control.Monad.Eff.Exception (EXCEPTION())
@@ -31,7 +32,7 @@ newtype TestBigInt = TestBigInt BigInt
3132
instance arbitraryBigInt :: Arbitrary TestBigInt where
3233
arbitrary = do
3334
n <- (fromMaybe zero <<< fromString) <$> digitString
34-
op <- elements id [negate]
35+
op <- elements (id :| [negate])
3536
pure (TestBigInt (op n))
3637
where digits :: Gen Int
3738
digits = chooseInt 0 9
@@ -48,7 +49,7 @@ testBinary :: forall eff. (BigInt -> BigInt -> BigInt)
4849
-> QC eff Unit
4950
testBinary f g = quickCheck (\x y -> (fromInt x) `f` (fromInt y) == fromInt (x `g` y))
5051

51-
main :: forall eff. Eff (console :: CONSOLE, assert :: ASSERT, random :: RANDOM, err :: EXCEPTION | eff) Unit
52+
main :: forall eff. Eff (console :: CONSOLE, assert :: ASSERT, random :: RANDOM, exception :: EXCEPTION | eff) Unit
5253
main = do
5354
log "Simple arithmetic operations and conversions from Int"
5455
let two = one + one

0 commit comments

Comments
 (0)