Skip to content

Commit 43cefe0

Browse files
authored
Merge pull request #34 from garyb/enum
Add missing Enum instances for A-E test types
2 parents 8585dae + 3dc15da commit 43cefe0

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/Test/QuickCheck/Laws.purs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module Test.QuickCheck.Laws
55

66
import Prelude
77
import Control.Monad.Eff.Console (log)
8-
import Data.Enum (class BoundedEnum)
8+
import Data.Enum (class Enum, class BoundedEnum)
99
import Data.Monoid (class Monoid)
1010
import Test.QuickCheck (QC)
1111
import Test.QuickCheck.Arbitrary (class Arbitrary, class Coarbitrary)
@@ -19,6 +19,7 @@ newtype A = A Ordering
1919

2020
derive newtype instance arbitraryAArbitrary A
2121
derive newtype instance boundedABounded A
22+
derive newtype instance enumA :: Enum A
2223
derive newtype instance boundedEnumA :: BoundedEnum A
2324
derive newtype instance coarbitraryACoarbitrary A
2425
derive newtype instance eqAEq A
@@ -30,43 +31,46 @@ newtype B = B Ordering
3031

3132
derive newtype instance arbitraryBArbitrary B
3233
derive newtype instance boundedBBounded B
34+
derive newtype instance enumB :: Enum B
3335
derive newtype instance boundedEnumB :: BoundedEnum B
3436
derive newtype instance coarbitraryBCoarbitrary B
3537
derive newtype instance eqBEq B
3638
derive newtype instance ordBOrd B
3739
derive newtype instance semigroupBSemigroup B
38-
instance monoidBMonoid B where mempty = B EQ
40+
instance monoidBMonoid B where mempty = B EQ
3941

4042
newtype C = C Ordering
4143

4244
derive newtype instance arbitraryCArbitrary C
4345
derive newtype instance boundedCBounded C
46+
derive newtype instance enumC :: Enum C
4447
derive newtype instance boundedEnumC :: BoundedEnum C
4548
derive newtype instance coarbitraryCCoarbitrary C
4649
derive newtype instance eqCEq C
4750
derive newtype instance ordCOrd C
4851
derive newtype instance semigroupCSemigroup C
4952
instance monoidCMonoid C where mempty = C EQ
50-
53+
5154
newtype D = D Ordering
5255

5356
derive newtype instance arbitraryDArbitrary D
5457
derive newtype instance boundedDBounded D
58+
derive newtype instance enumD :: Enum D
5559
derive newtype instance boundedEnumD :: BoundedEnum D
5660
derive newtype instance coarbitraryDCoarbitrary D
5761
derive newtype instance eqDEq D
5862
derive newtype instance ordDOrd D
5963
derive newtype instance semigroupDSemigroup D
6064
instance monoidDMonoid D where mempty = D EQ
61-
65+
6266
newtype E = E Ordering
6367

6468
derive newtype instance arbitraryEArbitrary E
6569
derive newtype instance boundedEBounded E
70+
derive newtype instance enumE :: Enum E
6671
derive newtype instance boundedEnumE :: BoundedEnum E
6772
derive newtype instance coarbitraryECoarbitrary E
6873
derive newtype instance eqEEq E
6974
derive newtype instance ordEOrd E
7075
derive newtype instance semigroupESemigroup E
71-
instance monoidEMonoid E where mempty = E EQ
72-
76+
instance monoidEMonoid E where mempty = E EQ

0 commit comments

Comments
 (0)