Skip to content

Commit

Permalink
Merge pull request #34 from garyb/enum
Browse files Browse the repository at this point in the history
Add missing Enum instances for A-E test types
  • Loading branch information
garyb authored Dec 11, 2017
2 parents 8585dae + 3dc15da commit 43cefe0
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/Test/QuickCheck/Laws.purs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Test.QuickCheck.Laws

import Prelude
import Control.Monad.Eff.Console (log)
import Data.Enum (class BoundedEnum)
import Data.Enum (class Enum, class BoundedEnum)
import Data.Monoid (class Monoid)
import Test.QuickCheck (QC)
import Test.QuickCheck.Arbitrary (class Arbitrary, class Coarbitrary)
Expand All @@ -19,6 +19,7 @@ newtype A = A Ordering

derive newtype instance arbitraryAArbitrary A
derive newtype instance boundedABounded A
derive newtype instance enumA :: Enum A
derive newtype instance boundedEnumA :: BoundedEnum A
derive newtype instance coarbitraryACoarbitrary A
derive newtype instance eqAEq A
Expand All @@ -30,43 +31,46 @@ newtype B = B Ordering

derive newtype instance arbitraryBArbitrary B
derive newtype instance boundedBBounded B
derive newtype instance enumB :: Enum B
derive newtype instance boundedEnumB :: BoundedEnum B
derive newtype instance coarbitraryBCoarbitrary B
derive newtype instance eqBEq B
derive newtype instance ordBOrd B
derive newtype instance semigroupBSemigroup B
instance monoidBMonoid B where mempty = B EQ
instance monoidBMonoid B where mempty = B EQ

newtype C = C Ordering

derive newtype instance arbitraryCArbitrary C
derive newtype instance boundedCBounded C
derive newtype instance enumC :: Enum C
derive newtype instance boundedEnumC :: BoundedEnum C
derive newtype instance coarbitraryCCoarbitrary C
derive newtype instance eqCEq C
derive newtype instance ordCOrd C
derive newtype instance semigroupCSemigroup C
instance monoidCMonoid C where mempty = C EQ

newtype D = D Ordering

derive newtype instance arbitraryDArbitrary D
derive newtype instance boundedDBounded D
derive newtype instance enumD :: Enum D
derive newtype instance boundedEnumD :: BoundedEnum D
derive newtype instance coarbitraryDCoarbitrary D
derive newtype instance eqDEq D
derive newtype instance ordDOrd D
derive newtype instance semigroupDSemigroup D
instance monoidDMonoid D where mempty = D EQ

newtype E = E Ordering

derive newtype instance arbitraryEArbitrary E
derive newtype instance boundedEBounded E
derive newtype instance enumE :: Enum E
derive newtype instance boundedEnumE :: BoundedEnum E
derive newtype instance coarbitraryECoarbitrary E
derive newtype instance eqEEq E
derive newtype instance ordEOrd E
derive newtype instance semigroupESemigroup E
instance monoidEMonoid E where mempty = E EQ

instance monoidEMonoid E where mempty = E EQ

0 comments on commit 43cefe0

Please sign in to comment.