set-with-0.0.1: Set of elements sorted by a different data type.

Safe HaskellNone
LanguageHaskell2010

Data.SetWith

Contents

Synopsis

Documentation

newtype SetWith k a Source

Constructors

SetWith 

Fields

unSetWith :: (a -> k, Map k a)
 

Instances

Foldable (SetWith k) Source 
Invariant (SetWith k) Source 
(Ord k, Monoid k) => Monoid (SetWith k a) Source 

Operators

(\\) :: Ord k => SetWith k a -> SetWith k a -> SetWith k a Source

Query

member :: Ord k => a -> SetWith k a -> Bool Source

notMember :: Ord k => a -> SetWith k a -> Bool Source

lookupLT :: Ord k => a -> SetWith k a -> Maybe a Source

lookupGT :: Ord k => a -> SetWith k a -> Maybe a Source

lookupLE :: Ord k => a -> SetWith k a -> Maybe a Source

lookupGE :: Ord k => a -> SetWith k a -> Maybe a Source

isSubsetOf :: (Eq a, Ord k) => SetWith k a -> SetWith k a -> Bool Source

isProperSubsetOf :: (Eq a, Ord k) => SetWith k a -> SetWith k a -> Bool Source

Construction

empty :: (a -> k) -> SetWith k a Source

singleton :: Ord k => (a -> k) -> a -> SetWith k a Source

insert :: Ord k => a -> SetWith k a -> SetWith k a Source

delete :: Ord k => a -> SetWith k a -> SetWith k a Source

Combine

union :: Ord k => SetWith k a -> SetWith k a -> SetWith k a Source

unions :: Ord k => (a -> k) -> [SetWith k a] -> SetWith k a Source

difference :: Ord k => SetWith k a -> SetWith k a -> SetWith k a Source

intersection :: Ord k => SetWith k a -> SetWith k a -> SetWith k a Source

Filter

filter :: (a -> Bool) -> SetWith k a -> SetWith k a Source

partition :: (a -> Bool) -> SetWith k a -> (SetWith k a, SetWith k a) Source

split :: Ord k => a -> SetWith k a -> (SetWith k a, SetWith k a) Source

splitMember :: Ord k => a -> SetWith k a -> (SetWith k a, Bool, SetWith k a) Source

splitRoot :: Ord k => SetWith k a -> [SetWith k a] Source

Indexed

lookupIndex :: Ord k => a -> SetWith k a -> Maybe Int Source

findIndex :: Ord k => a -> SetWith k a -> Int Source

elemAt :: Int -> SetWith k a -> a Source

deleteAt :: Int -> SetWith k a -> SetWith k a Source

Map

map :: (a -> b) -> (b -> a) -> SetWith k a -> SetWith k b Source

mapMaybe :: (a -> Maybe b) -> (b -> a) -> SetWith k a -> SetWith k b Source

Folds

foldr :: (a -> b -> b) -> b -> SetWith k a -> b Source

foldl :: (b -> a -> b) -> b -> SetWith k a -> b Source

Strict Folds

foldr' :: (a -> b -> b) -> b -> SetWith k a -> b Source

foldl' :: (b -> a -> b) -> b -> SetWith k a -> b Source

Legacy Fold

fold :: (a -> b -> b) -> b -> SetWith k a -> b Source

Min/Max

findMin :: SetWith k a -> a Source

findMax :: SetWith k a -> a Source

deleteFindMin :: SetWith k a -> (a, SetWith k a) Source

deleteFindMax :: SetWith k a -> (a, SetWith k a) Source

minView :: SetWith k a -> Maybe (a, SetWith k a) Source

maxView :: SetWith k a -> Maybe (a, SetWith k a) Source

Conversion

elems :: SetWith k a -> [a] Source

toList :: SetWith k a -> (a -> k, [a]) Source

fromList :: Ord k => (a -> k) -> [a] -> SetWith k a Source

Ordered List

toAscList :: SetWith k a -> [a] Source

toDescList :: SetWith k a -> [a] Source

fromAscList :: Eq k => (a -> k) -> [a] -> SetWith k a Source

fromDistinctAscList :: (a -> k) -> [a] -> SetWith k a Source

Debugging

showTree :: (Show k, Show a) => SetWith k a -> String Source

showTreeWith :: (Show k, Show a) => (k -> a -> String) -> Bool -> Bool -> SetWith k a -> String Source