summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-03-20 11:08:40 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-03-20 11:08:40 -0400
commitc538edd55032747f05fafefbd664c2f04423c1b8 (patch)
treeec73f33a36ec68ee50240c1983b178f390198c6e
parent8f8a146312ec999914d09451307327d190cbfb56 (diff)
fix build with QuickCheck 2.7.1
For some reason this was working w/o a cast before, despite POSIXTime etc being newtypes. It stopped working with the new QuickCheck: Utility/QuickCheck.hs:31:33: No instance for (Integral POSIXTime) arising from a use of `arbitrarySizedIntegral' Possible fix: add an instance declaration for (Integral POSIXTime) In the first argument of `nonNegative', namely `arbitrarySizedIntegral' In the expression: nonNegative arbitrarySizedIntegral In an equation for `arbitrary': arbitrary = nonNegative arbitrarySizedIntegral
-rw-r--r--Utility/QuickCheck.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Utility/QuickCheck.hs b/Utility/QuickCheck.hs
index e2539f3d6..7f7234c7c 100644
--- a/Utility/QuickCheck.hs
+++ b/Utility/QuickCheck.hs
@@ -28,10 +28,10 @@ instance (Arbitrary v, Eq v, Ord v) => Arbitrary (S.Set v) where
{- Times before the epoch are excluded. -}
instance Arbitrary POSIXTime where
- arbitrary = nonNegative arbitrarySizedIntegral
+ arbitrary = fromInteger <$> nonNegative arbitrarySizedIntegral
instance Arbitrary EpochTime where
- arbitrary = nonNegative arbitrarySizedIntegral
+ arbitrary = fromInteger <$> nonNegative arbitrarySizedIntegral
{- Pids are never negative, or 0. -}
instance Arbitrary ProcessID where