File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -273,7 +273,7 @@ addLists xs ys = xs ++ ys
273
273
274
274
addSucc :: forall a b . GraphRep a b -> Node -> Int -> IM. IntMap [b ] -> GraphRep a b
275
275
addSucc g0 v numAdd xs
276
- | numAdd < bulkThreshold = IM. foldlWithKey' go g0 xs
276
+ | numAdd < bulkThreshold = foldlWithKey' go g0 xs
277
277
where
278
278
go :: GraphRep a b -> Node -> [b ] -> GraphRep a b
279
279
go g p l = IMS. adjust f p g
@@ -285,9 +285,19 @@ addSucc g v _ xs = IMS.differenceWith go g xs
285
285
go (ps, l', ss) l = let ! ss' = IM. insertWith addLists v l ss
286
286
in Just (ps, l', ss')
287
287
288
+ foldlWithKey' :: (a -> IM. Key -> b -> a ) -> a -> IntMap b -> a
289
+ foldlWithKey' =
290
+ #if MIN_VERSION_containers (0,4,2)
291
+ IM. foldlWithKey'
292
+ #else
293
+ IM. foldWithKey . adjustFunc
294
+ where
295
+ adjustFunc f k b a = f a k b
296
+ #endif
297
+
288
298
addPred :: forall a b . GraphRep a b -> Node -> Int -> IM. IntMap [b ] -> GraphRep a b
289
299
addPred g0 v numAdd xs
290
- | numAdd < bulkThreshold = IM. foldlWithKey' go g0 xs
300
+ | numAdd < bulkThreshold = foldlWithKey' go g0 xs
291
301
where
292
302
go :: GraphRep a b -> Node -> [b ] -> GraphRep a b
293
303
go g p l = IMS. adjust f p g
You can’t perform that action at this time.
0 commit comments