strict-data-0.2.0.2: A collection of commonly used strict data structures

Safe HaskellNone
LanguageHaskell2010

Data.Map.Ordered

Description

An ordered, strict map.

One might think that Strict already provides such a data type. This is not correct. Lazy and Strict use the same, non-strict Map datatype. Strict just provides functions that evaluate the value argument before inserting it in the Map. The problem is that the typeclass instances of the shared Map datatype use the non-strict functions.

Documentation

data OSMap k v Source #

Instances

Functor (OSMap k) Source # 

Methods

fmap :: (a -> b) -> OSMap k a -> OSMap k b #

(<$) :: a -> OSMap k b -> OSMap k a #

Foldable (OSMap k) Source # 

Methods

fold :: Monoid m => OSMap k m -> m #

foldMap :: Monoid m => (a -> m) -> OSMap k a -> m #

foldr :: (a -> b -> b) -> b -> OSMap k a -> b #

foldr' :: (a -> b -> b) -> b -> OSMap k a -> b #

foldl :: (b -> a -> b) -> b -> OSMap k a -> b #

foldl' :: (b -> a -> b) -> b -> OSMap k a -> b #

foldr1 :: (a -> a -> a) -> OSMap k a -> a #

foldl1 :: (a -> a -> a) -> OSMap k a -> a #

toList :: OSMap k a -> [a] #

null :: OSMap k a -> Bool #

length :: OSMap k a -> Int #

elem :: Eq a => a -> OSMap k a -> Bool #

maximum :: Ord a => OSMap k a -> a #

minimum :: Ord a => OSMap k a -> a #

sum :: Num a => OSMap k a -> a #

product :: Num a => OSMap k a -> a #

Traversable (OSMap k) Source # 

Methods

traverse :: Applicative f => (a -> f b) -> OSMap k a -> f (OSMap k b) #

sequenceA :: Applicative f => OSMap k (f a) -> f (OSMap k a) #

mapM :: Monad m => (a -> m b) -> OSMap k a -> m (OSMap k b) #

sequence :: Monad m => OSMap k (m a) -> m (OSMap k a) #

(Eq v, Eq k) => Eq (OSMap k v) Source # 

Methods

(==) :: OSMap k v -> OSMap k v -> Bool #

(/=) :: OSMap k v -> OSMap k v -> Bool #

(Ord k, Data v, Data k) => Data (OSMap k v) Source # 

Methods

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

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

toConstr :: OSMap k v -> Constr #

dataTypeOf :: OSMap k v -> DataType #

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

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

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

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

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

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

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

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

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

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

(Ord v, Ord k) => Ord (OSMap k v) Source # 

Methods

compare :: OSMap k v -> OSMap k v -> Ordering #

(<) :: OSMap k v -> OSMap k v -> Bool #

(<=) :: OSMap k v -> OSMap k v -> Bool #

(>) :: OSMap k v -> OSMap k v -> Bool #

(>=) :: OSMap k v -> OSMap k v -> Bool #

max :: OSMap k v -> OSMap k v -> OSMap k v #

min :: OSMap k v -> OSMap k v -> OSMap k v #

(Read v, Read k, Ord k) => Read (OSMap k v) Source # 
(Show v, Show k) => Show (OSMap k v) Source # 

Methods

showsPrec :: Int -> OSMap k v -> ShowS #

show :: OSMap k v -> String #

showList :: [OSMap k v] -> ShowS #

Ord k => Monoid (OSMap k v) Source # 

Methods

mempty :: OSMap k v #

mappend :: OSMap k v -> OSMap k v -> OSMap k v #

mconcat :: [OSMap k v] -> OSMap k v #

(Ord k, Arbitrary k, Arbitrary v) => Arbitrary (OSMap k v) Source # 

Methods

arbitrary :: Gen (OSMap k v) #

shrink :: OSMap k v -> [OSMap k v] #

(Hashable k, Hashable v) => Hashable (OSMap k v) Source # 

Methods

hashWithSalt :: Int -> OSMap k v -> Int #

hash :: OSMap k v -> Int #

(NFData v, NFData k) => NFData (OSMap k v) Source # 

Methods

rnf :: OSMap k v -> () #

type Map = OSMap Source #

lookup :: Ord k => k -> OSMap k v -> Maybe v Source #

insert :: Ord k => k -> v -> OSMap k v -> OSMap k v Source #

delete :: Ord k => k -> OSMap k v -> OSMap k v Source #

fromList :: Ord k => [(k, v)] -> OSMap k v Source #

fromListWith :: Ord k => (v -> v -> v) -> [(k, v)] -> OSMap k v Source #

toList :: OSMap k v -> [(k, v)] Source #

map :: (v -> v') -> OSMap k v -> OSMap k v' Source #

mapMaybe :: (v -> Maybe v') -> OSMap k v -> OSMap k v' Source #

lookupLT :: Ord k => k -> OSMap k v -> Maybe (k, v) Source #

lookupGT :: Ord k => k -> OSMap k v -> Maybe (k, v) Source #

lookupLE :: Ord k => k -> OSMap k v -> Maybe (k, v) Source #

lookupGE :: Ord k => k -> OSMap k v -> Maybe (k, v) Source #

lookupM :: (Show k, Ord k, Monad m) => k -> OSMap k v -> m v Source #

elemAt :: Int -> OSMap k a -> (k, a) Source #

singleton :: k -> v -> OSMap k v Source #

insertWith :: Ord k => (v -> v -> v) -> k -> v -> OSMap k v -> OSMap k v Source #

member :: Ord k => k -> OSMap k v -> Bool Source #

elems :: OSMap k v -> [v] Source #

unionWith :: Ord k => (v -> v -> v) -> OSMap k v -> OSMap k v -> OSMap k v Source #

difference :: Ord k => OSMap k v -> OSMap k w -> OSMap k v Source #

union :: Ord k => OSMap k v -> OSMap k v -> OSMap k v Source #

findWithDefault :: Ord k => a -> k -> OSMap k a -> a Source #

size :: OSMap k v -> Int Source #

null :: OSMap k v -> Bool Source #

isSubmapOf :: (Ord k, Eq a) => OSMap k a -> OSMap k a -> Bool Source #

unions :: Ord k => [OSMap k v] -> OSMap k v Source #

intersection :: Ord k => OSMap k v -> OSMap k w -> OSMap k v Source #

foldrWithKey :: (k -> v -> a -> a) -> a -> OSMap k v -> a Source #

foldlWithKey :: (a -> k -> v -> a) -> a -> OSMap k v -> a Source #

filter :: (v -> Bool) -> OSMap k v -> OSMap k v Source #

filterWithKey :: (k -> v -> Bool) -> OSMap k v -> OSMap k v Source #

keys :: OSMap k v -> [k] Source #

toDescList :: OSMap k v -> [(k, v)] Source #

updateLookupWithKey :: Ord k => (k -> a -> Maybe a) -> k -> OSMap k a -> (Maybe a, OSMap k a) Source #

deleteLookup :: Ord k => k -> OSMap k v -> (Maybe v, OSMap k v) Source #

insertLookupWithKey :: Ord k => (k -> a -> a -> a) -> k -> a -> OSMap k a -> (Maybe a, OSMap k a) Source #

adjust :: Ord k => (a -> a) -> k -> Map k a -> Map k a Source #

assocs :: OSMap k a -> [(k, a)] Source #

insertWith' :: Ord k => (a -> a -> a) -> k -> a -> OSMap k a -> OSMap k a Source #

alter :: Ord k => (Maybe a -> Maybe a) -> k -> OSMap k a -> OSMap k a Source #

differenceWith :: Ord k => (a -> b -> Maybe a) -> OSMap k a -> OSMap k b -> OSMap k a Source #

updateWithKey :: Ord k => (k -> a -> Maybe a) -> k -> OSMap k a -> OSMap k a Source #

update :: Ord k => (a -> Maybe a) -> k -> OSMap k a -> OSMap k a Source #

mapKeys :: Ord k2 => (k1 -> k2) -> OSMap k1 a -> OSMap k2 a Source #

insertWithKey :: Ord k => (k -> a -> a -> a) -> k -> a -> Map k a -> Map k a Source #

insertWithKey' :: Ord k => (k -> a -> a -> a) -> k -> a -> Map k a -> Map k a Source #

keysSet :: OSMap k v -> Set k Source #

maxView :: OSMap k a -> Maybe (a, OSMap k a) Source #

maxViewWithKey :: OSMap k a -> Maybe ((k, a), OSMap k a) Source #

minView :: OSMap k a -> Maybe (a, OSMap k a) Source #

minViewWithKey :: OSMap k a -> Maybe ((k, a), OSMap k a) Source #

intersectionWith :: Ord k => (a -> b -> c) -> OSMap k a -> OSMap k b -> OSMap k c Source #

fromDistinctAscList :: [(k, v)] -> OSMap k v Source #

toDataMap :: OSMap k v -> Map k v Source #

fromDataMap :: Map k v -> OSMap k v Source #