packages feed

ixset-typed-conversions 0.1.1.0 → 0.1.1.1

raw patch · 2 files changed

+2/−2 lines, 2 files

Files

ixset-typed-conversions.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack  name:           ixset-typed-conversions-version:        0.1.1.0+version:        0.1.1.1 synopsis:       Conversions from ixset-typed to other containers. description:    Conversions from ixset-typed to other containers; HashMaps, zippers. category:       Data Structures
src/Data/IxSet/Typed/Conversions.hs view
@@ -60,7 +60,7 @@ toAscCofreeListM :: (Ord b, Ix.IsIndexOf ix ixs, Monad m) => (ix -> m c) -> (a -> c) -> (a -> b) -> Ix.IxSet ixs a -> m [Cofree [] c] toAscCofreeListM f g h xs = forM (Ix.groupAscBy xs) $ \(x, as) -> liftA2 (:<) (f x) (return $ map ((:< []) . g) (L.sortOn h as)) ----- | Convert an `IxSet` to a list of `Cofree` by grouping on one of its indices. The result will be sorted in descending+-- | Convert an `IxSet` to a list of `Cofree` by grouping on one of its indices. The result will be sorted in descending -- order on the index. The elements will be sorted according to the `Ord` instance on b. toDescCofreeList :: (Ord b, Ix.IsIndexOf ix ixs) => (ix -> c) -> (a -> c) -> (a -> b) -> Ix.IxSet ixs a -> [Cofree [] c] toDescCofreeList f g h xs = flip map (Ix.groupDescBy xs) $ \(x, as) -> f x :< map ((:< []) . g) (L.sortOn h as)