Fix ambiguity error in Opposite tests

For some reason cabal wasn't properly recompiling this file locally to
pick up the introduction of an ambiguity error.
This commit is contained in:
Griffin Smith 2019-12-31 11:28:51 -05:00
parent 0373e06c02
commit 14997bc1a3
2 changed files with 4 additions and 2 deletions

View file

@ -334,6 +334,7 @@ data Corner
| BottomLeft
| BottomRight
deriving stock (Show, Eq, Ord, Enum, Bounded, Generic)
deriving Arbitrary via GenericArbitrary Corner
instance Opposite Corner where
opposite TopLeft = BottomRight
@ -347,6 +348,7 @@ data Edge
| RightEdge
| BottomEdge
deriving stock (Show, Eq, Ord, Enum, Bounded, Generic)
deriving Arbitrary via GenericArbitrary Edge
instance Opposite Edge where
opposite TopEdge = BottomEdge

View file

@ -57,14 +57,14 @@ test = testGroup "Xanthous.Data"
, testGroup "Corner"
[ testGroup "instance Opposite"
[ testProperty "involutive" $ \corner ->
[ testProperty "involutive" $ \(corner :: Corner) ->
opposite (opposite corner) === corner
]
]
, testGroup "Edge"
[ testGroup "instance Opposite"
[ testProperty "involutive" $ \edge ->
[ testProperty "involutive" $ \(edge :: Edge) ->
opposite (opposite edge) === edge
]
]