diff options
author | Joey Hess <joey@kitenet.net> | 2014-02-12 17:54:28 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-02-12 17:57:32 -0400 |
commit | 41e5f8dfe79d6db8b0bd1492d8f28caf6b24ef5f (patch) | |
tree | b39ece56837a212d8ca147c24154fcecaf9a647f /Utility/QuickCheck.hs | |
parent | 595bb1862bb32462ad743b790c1c4e536569e60f (diff) |
data types and serialization for metadata
A very haskell commit! Just data types, instances to serialize the metadata
to a nice format, and QuickCheck tests.
This commit was sponsored by Andreas Leha.
Diffstat (limited to 'Utility/QuickCheck.hs')
-rw-r--r-- | Utility/QuickCheck.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Utility/QuickCheck.hs b/Utility/QuickCheck.hs index 82af09f3d..e2539f3d6 100644 --- a/Utility/QuickCheck.hs +++ b/Utility/QuickCheck.hs @@ -1,6 +1,6 @@ {- QuickCheck with additional instances - - - Copyright 2012 Joey Hess <joey@kitenet.net> + - Copyright 2012-2014 Joey Hess <joey@kitenet.net> - - Licensed under the GNU GPL version 3 or higher. -} @@ -17,11 +17,15 @@ import Test.QuickCheck as X import Data.Time.Clock.POSIX import System.Posix.Types import qualified Data.Map as M +import qualified Data.Set as S import Control.Applicative instance (Arbitrary k, Arbitrary v, Eq k, Ord k) => Arbitrary (M.Map k v) where arbitrary = M.fromList <$> arbitrary +instance (Arbitrary v, Eq v, Ord v) => Arbitrary (S.Set v) where + arbitrary = S.fromList <$> arbitrary + {- Times before the epoch are excluded. -} instance Arbitrary POSIXTime where arbitrary = nonNegative arbitrarySizedIntegral |