ixset-typed-conversions-0.1.1.0: Conversions from ixset-typed to other containers.

LicenseMIT
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Data.IxSet.Typed.Conversions

Description

Conversions from ixset-typed to other containers.

Synopsis

Documentation

toHashMap :: (Hashable a, IsIndexOf a xs) => IxSet xs k -> HashMap a [k] Source #

Convert an `IxSet to a HashMap.

toHashMapBy :: (Hashable a, IsIndexOf a xs) => IxSet xs k -> (a -> [k] -> k') -> HashMap a k' Source #

Convert an IxSet to a HashMap via a function on the index and associated list.

toHashMapByM :: (Monad m, Hashable a, IsIndexOf a xs) => IxSet xs k -> (a -> [k] -> m k') -> m (HashMap a k') Source #

Monadic variant of toHashMapBy.

toZipperAsc :: forall proxy ix ixs a m. (IsIndexOf ix ixs, MonadThrow m) => proxy ix -> IxSet ixs a -> m (Zipper [] a) Source #

Convert an IxSet to a Zipper by descending sort on an index.

toZipperDesc :: forall proxy ix ixs a m. (IsIndexOf ix ixs, MonadThrow m) => proxy ix -> IxSet ixs a -> m (Zipper [] a) Source #

Convert an IxSet to a Zipper by descending sort on an index.

toAscCofreeList :: (Ord b, IsIndexOf ix ixs) => (ix -> c) -> (a -> c) -> (a -> b) -> IxSet ixs a -> [Cofree [] c] Source #

Convert an IxSet to a list of Cofree by grouping on one of its indices. The result will be sorted in ascending order on the index. The elements will be sorted according to the Ord instance on b.

toAscCofreeListM :: (Ord b, IsIndexOf ix ixs, Monad m) => (ix -> m c) -> (a -> c) -> (a -> b) -> IxSet ixs a -> m [Cofree [] c] Source #

Monadic version of toAscCofreeList.

toDescCofreeList :: (Ord b, IsIndexOf ix ixs) => (ix -> c) -> (a -> c) -> (a -> b) -> IxSet ixs a -> [Cofree [] c] Source #

toDescCofreeListM :: (Ord b, IsIndexOf ix ixs, Monad m) => (ix -> m c) -> (a -> c) -> (a -> b) -> IxSet ixs a -> m [Cofree [] c] Source #

Monadic version of toDescCofreeList.