From ae6b52d05a60a54b5da07362303405c15b9355ed Mon Sep 17 00:00:00 2001 From: meooow25 Date: Wed, 20 Nov 2024 20:35:54 +0530 Subject: [PATCH] Fix test and Haddock tweaks --- containers-tests/tests/intmap-properties.hs | 2 +- containers/src/Data/IntMap/Internal.hs | 6 +++--- containers/src/Data/Map/Internal.hs | 7 +++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/containers-tests/tests/intmap-properties.hs b/containers-tests/tests/intmap-properties.hs index 3f67cad9d..1ead2c581 100644 --- a/containers-tests/tests/intmap-properties.hs +++ b/containers-tests/tests/intmap-properties.hs @@ -1524,7 +1524,7 @@ prop_filterWithKey :: Fun (Int, Int) Bool -> IMap -> Property prop_filterWithKey fun m = valid m' .&&. toList m' === Prelude.filter (apply fun) (toList m) where - m' = filterWithKey (apply2 fun) m + m' = filterWithKey (applyFun2 fun) m prop_partition :: Fun Int Bool -> [(Int, Int)] -> Property prop_partition p ys = length ys > 0 ==> diff --git a/containers/src/Data/IntMap/Internal.hs b/containers/src/Data/IntMap/Internal.hs index cba8d4d58..eeac5e173 100644 --- a/containers/src/Data/IntMap/Internal.hs +++ b/containers/src/Data/IntMap/Internal.hs @@ -2641,12 +2641,12 @@ filter p m -- | \(O(n)\). Filter all keys that satisfy some predicate. -- --- > filterKeys (> 4) (fromList [(5,"a"), (3,"b")]) == singleton 5 "a" --- -- @ --- filterKeys p = 'filterWithKey' (\k _ -> p k) +-- filterKeys p = 'filterWithKey' (\\k _ -> p k) -- @ -- +-- > filterKeys (> 4) (fromList [(5,"a"), (3,"b")]) == singleton 5 "a" +-- -- @since FIXME filterKeys :: (Key -> Bool) -> IntMap a -> IntMap a diff --git a/containers/src/Data/Map/Internal.hs b/containers/src/Data/Map/Internal.hs index d344c16f5..2f97aeb95 100644 --- a/containers/src/Data/Map/Internal.hs +++ b/containers/src/Data/Map/Internal.hs @@ -2947,13 +2947,12 @@ filter p m -- | \(O(n)\). Filter all keys that satisfy the predicate. -- --- > filterKeys (> 4) (fromList [(5,"a"), (3,"b")]) == singleton 5 "a" --- > filterKeys (> 4) == filterWithKey (\k _ -> k > 4) --- -- @ --- filterKeys p = 'filterWithKey' (\k _ -> p k) +-- filterKeys p = 'filterWithKey' (\\k _ -> p k) -- @ -- +-- > filterKeys (> 4) (fromList [(5,"a"), (3,"b")]) == singleton 5 "a" +-- -- @since FIXME filterKeys :: (k -> Bool) -> Map k a -> Map k a