primitive-containers-0.3.1: containers backed by arrays

Safe HaskellNone
LanguageHaskell2010

Data.Diet.Map.Strict.Unboxed.Lifted

Contents

Synopsis

Documentation

data Map k v Source #

Instances
(Prim k, Ord k, Enum k, Eq v) => IsList (Map k v) Source # 
Instance details

Defined in Data.Diet.Map.Strict.Unboxed.Lifted

Associated Types

type Item (Map k v) :: Type #

Methods

fromList :: [Item (Map k v)] -> Map k v #

fromListN :: Int -> [Item (Map k v)] -> Map k v #

toList :: Map k v -> [Item (Map k v)] #

(Prim k, Eq k, Eq v) => Eq (Map k v) Source # 
Instance details

Defined in Data.Diet.Map.Strict.Unboxed.Lifted

Methods

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

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

(Prim k, Show k, Show v) => Show (Map k v) Source # 
Instance details

Defined in Data.Diet.Map.Strict.Unboxed.Lifted

Methods

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

show :: Map k v -> String #

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

(Prim k, Ord k, Enum k, Semigroup v, Eq v) => Semigroup (Map k v) Source # 
Instance details

Defined in Data.Diet.Map.Strict.Unboxed.Lifted

Methods

(<>) :: Map k v -> Map k v -> Map k v #

sconcat :: NonEmpty (Map k v) -> Map k v #

stimes :: Integral b => b -> Map k v -> Map k v #

(Prim k, Ord k, Enum k, Semigroup v, Eq v) => Monoid (Map k v) Source # 
Instance details

Defined in Data.Diet.Map.Strict.Unboxed.Lifted

Methods

mempty :: Map k v #

mappend :: Map k v -> Map k v -> Map k v #

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

type Item (Map k v) Source # 
Instance details

Defined in Data.Diet.Map.Strict.Unboxed.Lifted

type Item (Map k v) = (k, k, v)

empty :: Map k v Source #

The empty diet map.

singleton Source #

Arguments

:: (Prim k, Ord k) 
=> k

inclusive lower bound

-> k

inclusive upper bound

-> v

value

-> Map k v 

O(1) Create a diet map with a single element.

lookup :: (Prim k, Ord k) => k -> Map k v -> Maybe v Source #

O(log n) Lookup the value at a key in the map.

mapBijection Source #

Arguments

:: (Prim k, Ord k) 
=> (v -> w)

bijection

-> Map k v 
-> Map k w 

Map an equality morphism over the values in a diet map. An bijection f must satisfy the law:

∀ x y. x == y ↔ f x == f y

Since this does not actually use the Eq constraint on the new value type, it is lazy in the values.

fromSet :: Prim k => (k -> k -> v) -> Set k -> Map k v Source #

Convert a diet set to a diet map, constructing each value from the low and high key in its corresponding range.

List Conversion

fromList :: (Ord k, Enum k, Prim k, Eq v) => [(k, k, v)] -> Map k v Source #

fromListAppend :: (Ord k, Enum k, Prim k, Semigroup v, Eq v) => [(k, k, v)] -> Map k v Source #

fromListN Source #

Arguments

:: (Ord k, Enum k, Prim k, Eq v) 
=> Int

expected size of resulting Map

-> [(k, k, v)]

key-value pairs

-> Map k v 

fromListAppendN Source #

Arguments

:: (Ord k, Enum k, Prim k, Semigroup v, Eq v) 
=> Int

expected size of resulting Map

-> [(k, k, v)]

key-value pairs

-> Map k v