diff options
author | Mikolaj Konarski <mikolaj.konarski@funktory.com> | 2025-05-10 21:49:25 +0200 |
---|---|---|
committer | Mikolaj Konarski <mikolaj.konarski@funktory.com> | 2025-05-10 21:49:25 +0200 |
commit | 7beccc54642a793507a2b2a1349dd61cc86a73e7 (patch) | |
tree | aa7ef0cc5de691adf4ca7fdc22b702b75ea664fb | |
parent | 959162c251fe2a0b4847324f54ebe01ef20574a1 (diff) |
Expose all the implemented operations
-rw-r--r-- | src/Data/Dependent/EnumMap/Strict.hs | 162 | ||||
-rw-r--r-- | src/Data/Dependent/EnumMap/Strict/Internal.hs | 18 |
2 files changed, 90 insertions, 90 deletions
diff --git a/src/Data/Dependent/EnumMap/Strict.hs b/src/Data/Dependent/EnumMap/Strict.hs index 515a186..8a2edd1 100644 --- a/src/Data/Dependent/EnumMap/Strict.hs +++ b/src/Data/Dependent/EnumMap/Strict.hs @@ -11,47 +11,47 @@ module Data.Dependent.EnumMap.Strict ( -- ** From Unordered Lists fromList, - -- fromListWith - -- fromListWithKey + fromListWith, + fromListWithKey, -- ** From Ascending Lists - -- fromAscList - -- fromAscListWith - -- fromAscListWithKey + fromAscList, + fromAscListWith, + fromAscListWithKey, fromDistinctAscList, -- * Insertion insert, - -- insertWith + insertWith, insertWithKey, - -- insertLookupWithKey + insertLookupWithKey, -- * Deletion\/Update delete, adjust, - -- adjustWithKey - -- update - -- updateWithKey - -- updateLookupWithKey + adjustWithKey, + update, + updateWithKey, + updateLookupWithKey, alter, - -- alterF + alterF, -- * Query -- ** Lookup lookup, - -- (!?) - -- (!) + (!?), + (!), findWithDefault, member, - -- notMember - -- lookupLT - -- lookupGT - -- lookupLE - -- lookupGE + notMember, + lookupLT, + lookupGT, + lookupLE, + lookupGE, -- ** Size @@ -63,70 +63,70 @@ module Data.Dependent.EnumMap.Strict ( union, unionWith, - -- unionWithKey - -- unions - -- unionsWith + unionWithKey, + unions, + unionsWith, -- ** Difference difference, - -- (\\) - -- differenceWith - -- differenceWithKey + (\\), + differenceWith, + differenceWithKey, -- ** Intersection - -- intersection - -- intersectionWith - -- intersectionWithKey + intersection, + intersectionWith, + intersectionWithKey, -- ** Disjoint - -- disjoint + disjoint, -- ** Compose - -- compose + compose, -- ** Universal combining function - -- mergeWithKey + mergeWithKey, -- * Traversal -- ** Map - -- map - -- mapWithKey - -- traverseWithKey - -- traverseMaybeWithKey - -- mapAccum - -- mapAccumWithKey - -- mapAccumRWithKey - -- mapKeys - -- mapKeysWith - -- mapKeysMonotonic + map, + mapWithKey, + traverseWithKey, + traverseMaybeWithKey, + mapAccum, + mapAccumWithKey, + mapAccumRWithKey, + -- mapKeys, + -- mapKeysWith, + -- mapKeysMonotonic, -- * Folds - -- foldr - -- foldl - -- foldrWithKey - -- foldlWithKey - -- foldMapWithKey + foldr, + foldl, + foldrWithKey, + foldlWithKey, + foldMapWithKey, -- ** Strict folds - -- foldr' - -- foldl' - -- foldrWithKey' - -- foldlWithKey' + foldr', + foldl', + foldrWithKey', + foldlWithKey', -- * Conversion elems, keys, - -- assocs + assocs, -- keysSet -- ** Lists @@ -140,48 +140,50 @@ module Data.Dependent.EnumMap.Strict ( -- * Filter - -- filter - -- filterWithKey + filter, + filterWithKey, -- restrictKeys -- withoutKeys partition, partitionWithKey, - -- takeWhileAntitone - -- dropWhileAntitone - -- spanAntitone + takeWhileAntitone, + dropWhileAntitone, + spanAntitone, - -- mapMaybe - -- mapMaybeWithKey - -- mapEither - -- mapEitherWithKey + mapMaybe, + mapMaybeWithKey, + mapEither, + mapEitherWithKey, - -- split - -- splitLookup - -- splitRoot + split, + splitLookup, + splitRoot, -- * Submap - -- isSubmapOf, isSubmapOfBy - -- isProperSubmapOf, isProperSubmapOfBy + isSubmapOf, + isSubmapOfBy, + isProperSubmapOf, + isProperSubmapOfBy, -- * Min\/Max - -- lookupMin - -- lookupMax - -- findMin - -- findMax - -- deleteMin - -- deleteMax - -- deleteFindMin - -- deleteFindMax - -- updateMin - -- updateMax - -- updateMinWithKey - -- updateMaxWithKey - -- minView - -- maxView - -- minViewWithKey + lookupMin, + lookupMax, + findMin, + findMax, + deleteMin, + deleteMax, + deleteFindMin, + deleteFindMax, + updateMin, + updateMax, + updateMinWithKey, + updateMaxWithKey, + minView, + maxView, + minViewWithKey, maxViewWithKey, ) where diff --git a/src/Data/Dependent/EnumMap/Strict/Internal.hs b/src/Data/Dependent/EnumMap/Strict/Internal.hs index ab32a31..bb1ee29 100644 --- a/src/Data/Dependent/EnumMap/Strict/Internal.hs +++ b/src/Data/Dependent/EnumMap/Strict/Internal.hs @@ -417,12 +417,12 @@ foldr f acc0 (DEnumMap m) = IM.foldr (\(KV _ v) acc -> f v acc) acc0 m foldl :: (forall a. acc -> v a -> acc) -> acc -> DEnumMap k v -> acc foldl f acc0 (DEnumMap m) = IM.foldl (\acc (KV _ v) -> f acc v) acc0 m -foldrWith :: Enum1 k => (forall a. k a -> v a -> acc -> acc) -> acc -> DEnumMap k v -> acc -foldrWith f acc0 (DEnumMap m) = +foldrWithKey :: Enum1 k => (forall a. k a -> v a -> acc -> acc) -> acc -> DEnumMap k v -> acc +foldrWithKey f acc0 (DEnumMap m) = IM.foldrWithKey (\i (KV inf v) acc -> case toEnum1 i inf of Some k -> f k (coe1 v) acc) acc0 m -foldlWith :: Enum1 k => (forall a. acc -> k a -> v a -> acc) -> acc -> DEnumMap k v -> acc -foldlWith f acc0 (DEnumMap m) = +foldlWithKey :: Enum1 k => (forall a. acc -> k a -> v a -> acc) -> acc -> DEnumMap k v -> acc +foldlWithKey f acc0 (DEnumMap m) = IM.foldlWithKey (\acc i (KV inf v) -> case toEnum1 i inf of Some k -> f acc k (coe1 v)) acc0 m foldMapWithKey :: (Monoid m, Enum1 k) => (forall a. k a -> v a -> m) -> DEnumMap k v -> m @@ -437,12 +437,12 @@ foldr' f acc0 (DEnumMap m) = IM.foldr' (\(KV _ v) acc -> f v acc) acc0 m foldl' :: (forall a. acc -> v a -> acc) -> acc -> DEnumMap k v -> acc foldl' f acc0 (DEnumMap m) = IM.foldl' (\acc (KV _ v) -> f acc v) acc0 m -foldrWith' :: Enum1 k => (forall a. k a -> v a -> acc -> acc) -> acc -> DEnumMap k v -> acc -foldrWith' f acc0 (DEnumMap m) = +foldrWithKey' :: Enum1 k => (forall a. k a -> v a -> acc -> acc) -> acc -> DEnumMap k v -> acc +foldrWithKey' f acc0 (DEnumMap m) = IM.foldrWithKey' (\i (KV inf v) acc -> case toEnum1 i inf of Some k -> f k (coe1 v) acc) acc0 m -foldlWith' :: Enum1 k => (forall a. acc -> k a -> v a -> acc) -> acc -> DEnumMap k v -> acc -foldlWith' f acc0 (DEnumMap m) = +foldlWithKey' :: Enum1 k => (forall a. acc -> k a -> v a -> acc) -> acc -> DEnumMap k v -> acc +foldlWithKey' f acc0 (DEnumMap m) = IM.foldlWithKey' (\acc i (KV inf v) -> case toEnum1 i inf of Some k -> f acc k (coe1 v)) acc0 m -- * Conversion @@ -474,8 +474,6 @@ toDescList (DEnumMap m) = kVToDSum <$> IM.toDescList m -- * Filter --- filter - filter :: (forall a. v a -> Bool) -> DEnumMap k v -> DEnumMap k v filter f (DEnumMap m) = DEnumMap (IM.filter (\(KV _ v) -> f v) m) |