Skip to content

Commit d8c5f22

Browse files
authored
Merge pull request #12 from justinwoo/compiler/0.12
updates for 0.12
2 parents 5e6ba7d + 7f79e74 commit d8c5f22

File tree

5 files changed

+27
-35
lines changed

5 files changed

+27
-35
lines changed

bower.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
"url": "git://github.com/purescript-contrib/purescript-hugenums.git"
1313
},
1414
"dependencies": {
15-
"purescript-arrays": "^4.0.0",
16-
"purescript-globals": "^3.0.0",
17-
"purescript-integers": "^3.0.0",
18-
"purescript-quickcheck": "^4.0.0",
19-
"purescript-generics": "^4.0.0",
20-
"purescript-strings": "^3.0.0"
15+
"purescript-arrays": "#compiler/0.12",
16+
"purescript-globals": "#compiler/0.12",
17+
"purescript-integers": "#compiler/0.12",
18+
"purescript-quickcheck": "#compiler/0.12",
19+
"purescript-generics-rep": "#compiler/0.12",
20+
"purescript-strings": "#compiler/0.12"
2121
},
2222
"devDependencies": {
23-
"purescript-quickcheck-laws": "^3.0.0"
23+
"purescript-quickcheck-laws": "#compiler/0.12"
2424
}
2525
}

src/Data/Digit.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ module Data.Digit
77

88
import Prelude
99
import Data.Char (toCharCode, fromCharCode)
10-
import Data.Generic (class Generic)
10+
import Data.Generic.Rep (class Generic)
1111
import Data.Maybe (Maybe(..))
1212

1313
newtype Digit = Digit Int
1414

15-
derive instance genericDigit :: Generic Digit
15+
derive instance genericDigit :: Generic Digit _
1616

1717
instance showDigit :: Show Digit where
1818
show (Digit n) = "Digit " <> show n

src/Data/HugeInt.purs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ module Data.HugeInt
1818

1919
import Prelude
2020

21-
import Data.String (length, drop, takeWhile)
22-
import Data.Generic (class Generic)
23-
import Data.Int (toNumber)
24-
import Data.Int (round) as Int
25-
import Data.Maybe (Maybe(..))
21+
import Data.Generic.Rep (class Generic)
2622
import Data.HugeNum (HugeNum)
2723
import Data.HugeNum as HN
24+
import Data.Int (round) as Int
25+
import Data.Int (toNumber)
26+
import Data.Maybe (Maybe(..))
27+
import Data.String (length, drop, takeWhile)
2828

2929
newtype HugeInt = HugeInt HugeNum
3030

31-
derive instance genericHugeInt :: Generic HugeInt
31+
derive instance genericHugeInt :: Generic HugeInt _
3232

3333
instance eqHugeInt :: Eq HugeInt where
3434
eq (HugeInt h1) (HugeInt h2) = h1 == h2

src/Data/HugeNum.purs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ module Data.HugeNum
2222
) where
2323

2424
import Prelude
25-
import Data.List as L
26-
import Control.Monad.Eff.Exception.Unsafe (unsafeThrow)
25+
2726
import Data.Digit (Digit, toInt, fromInt, fromChar, toChar, _zero, _one)
2827
import Data.Foldable (foldl, all, foldMap)
29-
import Data.Generic (class Generic)
28+
import Data.Generic.Rep (class Generic)
3029
import Data.Int (round, odd, toNumber) as Int
3130
import Data.List (List(..), (:))
31+
import Data.List as L
3232
import Data.Maybe (Maybe(..), fromJust)
33-
import Data.Monoid (mempty)
3433
import Data.String (Pattern(..), toCharArray, contains, singleton)
3534
import Data.Traversable (sequence)
3635
import Data.Tuple (Tuple(..), fst, snd)
3736
import Data.Unfoldable (replicate)
37+
import Effect.Exception.Unsafe (unsafeThrow)
3838
import Global (readFloat)
3939
import Partial.Unsafe (unsafePartial)
4040
import Test.QuickCheck.Arbitrary (class Arbitrary)
@@ -53,8 +53,8 @@ newtype HugeNum = HugeNum { digits :: List Digit, decimal :: Int, sign :: Sign }
5353

5454
-- | ##Instances
5555

56-
derive instance genericSign :: Generic Sign
57-
derive instance genericHugeNum :: Generic HugeNum
56+
derive instance genericSign :: Generic Sign _
57+
derive instance genericHugeNum :: Generic HugeNum _
5858

5959
instance arbHugeNum :: Arbitrary HugeNum where
6060
arbitrary = do

test/Main.purs

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,20 @@
11
module Test.Main where
22

33
import Prelude
4+
5+
import Data.HugeNum (HugeNum)
6+
import Effect (Effect)
7+
import Effect.Console (log)
48
import Test.QuickCheck.Laws.Data.Eq (checkEq)
59
import Test.QuickCheck.Laws.Data.Ord (checkOrd)
6-
import Test.QuickCheck.Laws.Data.Semiring (checkSemiring)
710
import Test.QuickCheck.Laws.Data.Ring (checkRing)
8-
import Data.HugeNum (HugeNum)
9-
import Control.Monad.Eff (Eff)
10-
import Control.Monad.Eff.Console (CONSOLE, log)
11-
import Control.Monad.Eff.Exception (EXCEPTION)
12-
import Control.Monad.Eff.Random (RANDOM)
11+
import Test.QuickCheck.Laws.Data.Semiring (checkSemiring)
1312
import Type.Proxy (Proxy(..))
1413

1514
prxHugeNum :: Proxy HugeNum
1615
prxHugeNum = Proxy
1716

18-
main :: forall eff.
19-
Eff
20-
( console :: CONSOLE
21-
, random :: RANDOM
22-
, exception :: EXCEPTION
23-
| eff
24-
)
25-
Unit
17+
main :: Effect Unit
2618
main = do
2719
log "Checking HugeNum instances...\n"
2820
checkEq prxHugeNum

0 commit comments

Comments
 (0)