From: John Goerzen Date: Thu, 29 May 2008 08:32:13 +0000 (-0500) Subject: compilation fixes X-Git-Url: https://code.delx.au/offlineimap/commitdiff_plain/9e33d028c1092ec31e2c603b36ec1a55093d9c14 compilation fixes --- diff --git a/src/Data/Syncable.hs b/src/Data/Syncable.hs index b076c80..4eac9ee 100644 --- a/src/Data/Syncable.hs +++ b/src/Data/Syncable.hs @@ -220,13 +220,13 @@ unaryApplyChanges collection commands = {- | Given the base input and a ModifyContent command, convert this to commands to sync. Ignores anything that is not a ModifyContent command by returning an empty list. -} -modifyToSync :: (Eq k, Ord k, Show k) => - SyncCollection k v - -> SyncCommand k v - -> [SyncCommand k v] -modifyToSync base (ModifyContent k v) = - case Map.lookup k base of - Nothing -> error $ "modifyToSync: attempt to modify on unknown base key " ++ show k +modifyToSync :: (Eq k, Ord k, Show k, Eq v, Show v, Eq v', Show v', Ord v) => + SyncCollection k (SyncCollection v v') + -> SyncCommand k (SyncCollection v v') + -> [SyncCommand v v'] +modifyToSync base (ModifyContent key val) = + case Map.lookup key base of + Nothing -> error $ "modifyToSync: attempt to modify on unknown base key " ++ show key Just basev -> - diffCollection basev v + diffCollection basev val modifyToSync _ _ = [] diff --git a/testsrc/runtests.hs b/testsrc/runtests.hs index 5d5312e..0b7f44a 100644 --- a/testsrc/runtests.hs +++ b/testsrc/runtests.hs @@ -185,13 +185,6 @@ prop_diffCollection coll1 coll2 = newcoll2 = unaryApplyChanges coll1 commands in coll2 @=? newcoll2 -prop_modifyToSyncSimple :: SyncCollection Int Word8 -> Word8 -> Result -prop_modifyToSyncSimple base newv - | Map.empty base = True @=? True - | otherwise = ([], [], [ModifyContent @=? - where k = fst . head . Map.toList base -prop_modifyToSync - q :: Testable a => String -> a -> HU.Test q = qccheck (defaultConfig {configMaxTest = 250})