Skip to content

Commit

Permalink
Updates for PureScript 0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkdp committed Apr 15, 2017
1 parent a84ea59 commit ce4614c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
10 changes: 5 additions & 5 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
"package.json"
],
"dependencies": {
"purescript-maybe": "^2.0.0"
"purescript-maybe": "^3.0.0"
},
"devDependencies": {
"purescript-integers": "^2.0.0",
"purescript-console": "^2.0.0",
"purescript-assert": "^2.0.0",
"purescript-quickcheck": "^3.0.0"
"purescript-integers": "^3.0.0",
"purescript-console": "^3.0.0",
"purescript-assert": "^3.0.0",
"purescript-quickcheck": "^4.0.0"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"build": "pulp test && rimraf docs && pulp docs"
},
"dependencies": {
"big-integer": "^1.6.9"
"big-integer": "^1.6.17"
},
"devDependencies": {
"pulp": "^9.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/Data/BigInt.purs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import Prelude
import Data.Maybe (Maybe(..))

-- | An arbitrary length integer.
foreign import data BigInt :: *
foreign import data BigInt :: Type

-- | FFI wrapper to parse a String in a given base representation into a BigInt.
foreign import fromBase' :: forall a. (a -> Maybe a)
Expand Down
5 changes: 3 additions & 2 deletions test/Main.purs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Data.BigInt (BigInt, abs, fromInt, prime, pow, odd, even, fromString,
toNumber, fromBase, toString)
import Data.Foldable (fold)
import Data.Maybe (Maybe(..), fromMaybe)
import Data.NonEmpty ((:|))
import Test.Assert (ASSERT, assert)
import Control.Monad.Eff.Random (RANDOM())
import Control.Monad.Eff.Exception (EXCEPTION())
Expand All @@ -31,7 +32,7 @@ newtype TestBigInt = TestBigInt BigInt
instance arbitraryBigInt :: Arbitrary TestBigInt where
arbitrary = do
n <- (fromMaybe zero <<< fromString) <$> digitString
op <- elements id [negate]
op <- elements (id :| [negate])
pure (TestBigInt (op n))
where digits :: Gen Int
digits = chooseInt 0 9
Expand All @@ -48,7 +49,7 @@ testBinary :: forall eff. (BigInt -> BigInt -> BigInt)
-> QC eff Unit
testBinary f g = quickCheck (\x y -> (fromInt x) `f` (fromInt y) == fromInt (x `g` y))

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

0 comments on commit ce4614c

Please sign in to comment.