summaryrefslogtreecommitdiff
path: root/src/Data
diff options
context:
space:
mode:
Diffstat (limited to 'src/Data')
-rw-r--r--src/Data/Dependent/EnumMap/Strict.hs6
-rw-r--r--src/Data/Dependent/EnumMap/Strict/Internal.hs4
2 files changed, 6 insertions, 4 deletions
diff --git a/src/Data/Dependent/EnumMap/Strict.hs b/src/Data/Dependent/EnumMap/Strict.hs
index 31f7e52..fd650b2 100644
--- a/src/Data/Dependent/EnumMap/Strict.hs
+++ b/src/Data/Dependent/EnumMap/Strict.hs
@@ -131,11 +131,11 @@ module Data.Dependent.EnumMap.Strict (
-- ** Lists
- -- toList
+ toList,
-- ** Ordered lists
- -- toAscList
+ toAscList,
toDescList,
-- * Filter
@@ -145,7 +145,7 @@ module Data.Dependent.EnumMap.Strict (
-- restrictKeys
-- withoutKeys
partition,
- -- partitionWithKey
+ partitionWithKey,
-- takeWhileAntitone
-- dropWhileAntitone
diff --git a/src/Data/Dependent/EnumMap/Strict/Internal.hs b/src/Data/Dependent/EnumMap/Strict/Internal.hs
index 7e54a64..0d944ba 100644
--- a/src/Data/Dependent/EnumMap/Strict/Internal.hs
+++ b/src/Data/Dependent/EnumMap/Strict/Internal.hs
@@ -247,7 +247,9 @@ partition :: (forall a. v a -> Bool) -> DEnumMap k v -> (DEnumMap k v, DEnumMap
partition f (DEnumMap m) =
bimap DEnumMap DEnumMap (IM.partition (\(KV _ v) -> f v) m)
--- partitionWithKey
+partitionWithKey :: Enum1 k => (forall a. k a -> v a -> Bool) -> DEnumMap k v -> (DEnumMap k v, DEnumMap k v)
+partitionWithKey f (DEnumMap m) =
+ bimap DEnumMap DEnumMap (IM.partitionWithKey (\i (KV inf v) -> case toEnum1 i inf of Some k -> f k (coe1 v)) m)
-- takeWhileAntitone
-- dropWhileAntitone