@@ -46,7 +46,14 @@ deriving instance (Show k, Show p, Show (PatchTarget p)) => Show (PatchMapWithPa
46
46
deriving instance (Ord k , Read k , Read p , Read (PatchTarget p )) => Read (PatchMapWithPatchingMove k p )
47
47
deriving instance (Eq k , Eq p , Eq (PatchTarget p )) => Eq (PatchMapWithPatchingMove k p )
48
48
deriving instance (Ord k , Ord p , Ord (PatchTarget p )) => Ord (PatchMapWithPatchingMove k p )
49
- deriving instance (Ord k , Monoid p , DecidablyEmpty p , Patch p ) => DecidablyEmpty (PatchMapWithPatchingMove k p )
49
+
50
+ deriving instance ( Ord k
51
+ #if !MIN_VERSION_base(4,11,0)
52
+ , Semigroup p
53
+ #endif
54
+ , DecidablyEmpty p
55
+ , Patch p
56
+ ) => DecidablyEmpty (PatchMapWithPatchingMove k p)
50
57
51
58
-- | Holds the information about each key: where its new value should come from,
52
59
-- and where its old value should go to
@@ -129,7 +136,13 @@ insertMapKey k v = PatchMapWithPatchingMove . Map.singleton k $ NodeInfo (From_I
129
136
-- 'Map.delete' src (maybe map ('Map.insert' dst) (Map.lookup src map))
130
137
-- @
131
138
moveMapKey
132
- :: (DecidablyEmpty p , Patch p ) => Ord k => k -> k -> PatchMapWithPatchingMove k p
139
+ :: ( DecidablyEmpty p
140
+ #if !MIN_VERSION_base(4,11,0)
141
+ , Semigroup p
142
+ #endif
143
+ , Patch p
144
+ )
145
+ => Ord k => k -> k -> PatchMapWithPatchingMove k p
133
146
moveMapKey src dst
134
147
| src == dst = mempty
135
148
| otherwise =
@@ -148,7 +161,12 @@ moveMapKey src dst
148
161
-- . Map.delete a . Map.delete b $ map
149
162
-- @
150
163
swapMapKey
151
- :: (DecidablyEmpty p , Patch p )
164
+ :: ( DecidablyEmpty p
165
+ #if !MIN_VERSION_base(4,11,0)
166
+ , Semigroup p
167
+ #endif
168
+ , Patch p
169
+ )
152
170
=> Ord k => k -> k -> PatchMapWithPatchingMove k p
153
171
swapMapKey src dst
154
172
| src == dst = mempty
@@ -290,7 +308,6 @@ instance ( Ord k
290
308
#if !MIN_VERSION_base(4,11,0)
291
309
, Semigroup p
292
310
#endif
293
- , Monoid p
294
311
, DecidablyEmpty p
295
312
, Patch p
296
313
) => Semigroup (PatchMapWithPatchingMove k p) where
@@ -352,7 +369,6 @@ instance ( Ord k
352
369
#if !MIN_VERSION_base(4,11,0)
353
370
, Semigroup p
354
371
#endif
355
- , Monoid p
356
372
, DecidablyEmpty p
357
373
, Patch p
358
374
) => Monoid (PatchMapWithPatchingMove k p) where
0 commit comments