insert-ordered-containers-0.2.3: Associative containers retaining insertion order for traversals.

Safe HaskellTrustworthy
LanguageHaskell2010

Data.HashSet.InsOrd

Contents

Description

InsOrdHashSet is like HashMap, but it folds in insertion order.

This module interface mimics Data.HashSet, with some additions.

Synopsis

Documentation

data InsOrdHashSet k Source #

HashSet which tries it's best to remember insertion order of elements.

Instances
Foldable InsOrdHashSet Source # 
Instance details

Defined in Data.HashSet.InsOrd

Methods

fold :: Monoid m => InsOrdHashSet m -> m #

foldMap :: Monoid m => (a -> m) -> InsOrdHashSet a -> m #

foldr :: (a -> b -> b) -> b -> InsOrdHashSet a -> b #

foldr' :: (a -> b -> b) -> b -> InsOrdHashSet a -> b #

foldl :: (b -> a -> b) -> b -> InsOrdHashSet a -> b #

foldl' :: (b -> a -> b) -> b -> InsOrdHashSet a -> b #

foldr1 :: (a -> a -> a) -> InsOrdHashSet a -> a #

foldl1 :: (a -> a -> a) -> InsOrdHashSet a -> a #

toList :: InsOrdHashSet a -> [a] #

null :: InsOrdHashSet a -> Bool #

length :: InsOrdHashSet a -> Int #

elem :: Eq a => a -> InsOrdHashSet a -> Bool #

maximum :: Ord a => InsOrdHashSet a -> a #

minimum :: Ord a => InsOrdHashSet a -> a #

sum :: Num a => InsOrdHashSet a -> a #

product :: Num a => InsOrdHashSet a -> a #

(Eq k, Hashable k) => IsList (InsOrdHashSet k) Source # 
Instance details

Defined in Data.HashSet.InsOrd

Associated Types

type Item (InsOrdHashSet k) :: Type #

Eq k => Eq (InsOrdHashSet k) Source # 
Instance details

Defined in Data.HashSet.InsOrd

(Data k, Eq k, Hashable k) => Data (InsOrdHashSet k) Source # 
Instance details

Defined in Data.HashSet.InsOrd

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> InsOrdHashSet k -> c (InsOrdHashSet k) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (InsOrdHashSet k) #

toConstr :: InsOrdHashSet k -> Constr #

dataTypeOf :: InsOrdHashSet k -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (InsOrdHashSet k)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (InsOrdHashSet k)) #

gmapT :: (forall b. Data b => b -> b) -> InsOrdHashSet k -> InsOrdHashSet k #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> InsOrdHashSet k -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> InsOrdHashSet k -> r #

gmapQ :: (forall d. Data d => d -> u) -> InsOrdHashSet k -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> InsOrdHashSet k -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> InsOrdHashSet k -> m (InsOrdHashSet k) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> InsOrdHashSet k -> m (InsOrdHashSet k) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> InsOrdHashSet k -> m (InsOrdHashSet k) #

(Eq k, Hashable k, Read k) => Read (InsOrdHashSet k) Source # 
Instance details

Defined in Data.HashSet.InsOrd

Show k => Show (InsOrdHashSet k) Source # 
Instance details

Defined in Data.HashSet.InsOrd

(Eq k, Hashable k) => Semigroup (InsOrdHashSet k) Source # 
Instance details

Defined in Data.HashSet.InsOrd

(Eq k, Hashable k) => Monoid (InsOrdHashSet k) Source # 
Instance details

Defined in Data.HashSet.InsOrd

Hashable k => Hashable (InsOrdHashSet k) Source #

hashWithSalt salt . toHashSet = hashWithSalt salt.

Instance details

Defined in Data.HashSet.InsOrd

ToJSON a => ToJSON (InsOrdHashSet a) Source # 
Instance details

Defined in Data.HashSet.InsOrd

(Eq a, Hashable a, FromJSON a) => FromJSON (InsOrdHashSet a) Source # 
Instance details

Defined in Data.HashSet.InsOrd

(Eq a, Hashable a) => Contains (InsOrdHashSet a) Source # 
Instance details

Defined in Data.HashSet.InsOrd

(Eq k, Hashable k) => Ixed (InsOrdHashSet k) Source # 
Instance details

Defined in Data.HashSet.InsOrd

(Eq k, Hashable k) => At (InsOrdHashSet k) Source # 
Instance details

Defined in Data.HashSet.InsOrd

(Eq a, Hashable a) => Contains (InsOrdHashSet a) Source # 
Instance details

Defined in Data.HashSet.InsOrd

(Eq k, Hashable k) => Ixed (InsOrdHashSet k) Source # 
Instance details

Defined in Data.HashSet.InsOrd

Associated Types

type IxKind (InsOrdHashSet k) :: OpticKind #

(Eq k, Hashable k) => At (InsOrdHashSet k) Source # 
Instance details

Defined in Data.HashSet.InsOrd

type Item (InsOrdHashSet k) Source # 
Instance details

Defined in Data.HashSet.InsOrd

type Item (InsOrdHashSet k) = k
type Index (InsOrdHashSet a) Source # 
Instance details

Defined in Data.HashSet.InsOrd

type Index (InsOrdHashSet a) = a
type IxValue (InsOrdHashSet a) Source # 
Instance details

Defined in Data.HashSet.InsOrd

type IxValue (InsOrdHashSet a) = ()
type Index (InsOrdHashSet a) Source # 
Instance details

Defined in Data.HashSet.InsOrd

type Index (InsOrdHashSet a) = a
type IxValue (InsOrdHashSet a) Source # 
Instance details

Defined in Data.HashSet.InsOrd

type IxValue (InsOrdHashSet a) = ()
type IxKind (InsOrdHashSet k) Source # 
Instance details

Defined in Data.HashSet.InsOrd

Construction

Basic interface

member :: (Eq k, Hashable k) => k -> InsOrdHashSet k -> Bool Source #

Combine

Transformations

map :: (Hashable b, Eq b) => (a -> b) -> InsOrdHashSet a -> InsOrdHashSet b Source #

Unordered

Difference and intersection

Folds

Unordered

Filter

Conversions

fromList :: (Eq k, Hashable k) => [k] -> InsOrdHashSet k Source #

Lenses

hashSet :: Iso' (InsOrdHashSet a) (HashSet a) Source #

This is a slight lie, as roundtrip doesn't preserve ordering.

Debugging

valid :: InsOrdHashSet a -> Bool Source #

Test if the internal map structure is valid.