Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
- data LinkedHashMap k v = LinkedHashMap (HashMap k (Entry v)) (Seq (Maybe (k, v))) !Int
- empty :: LinkedHashMap k v
- singleton :: (Eq k, Hashable k) => k -> v -> LinkedHashMap k v
- null :: LinkedHashMap k v -> Bool
- size :: LinkedHashMap k v -> Int
- member :: (Eq k, Hashable k) => k -> LinkedHashMap k a -> Bool
- lookup :: (Eq k, Hashable k) => k -> LinkedHashMap k v -> Maybe v
- lookupDefault :: (Eq k, Hashable k) => v -> k -> LinkedHashMap k v -> v
- (!) :: (Eq k, Hashable k) => LinkedHashMap k v -> k -> v
- insert :: (Eq k, Hashable k) => k -> v -> LinkedHashMap k v -> LinkedHashMap k v
- delete :: (Eq k, Hashable k) => k -> LinkedHashMap k v -> LinkedHashMap k v
- map :: (a -> b) -> [a] -> [b]
- keys :: (Eq k, Hashable k) => LinkedHashMap k v -> [k]
- elems :: (Eq k, Hashable k) => LinkedHashMap k v -> [v]
- toList :: LinkedHashMap k v -> [(k, v)]
- fromList :: (Eq k, Hashable k) => [(k, v)] -> LinkedHashMap k v
- pack :: (Eq k, Hashable k) => LinkedHashMap k v -> LinkedHashMap k v
Documentation
data LinkedHashMap k v Source
LinkedHashMap (HashMap k (Entry v)) (Seq (Maybe (k, v))) !Int |
(Show k, Show v) => Show (LinkedHashMap k v) | |
(NFData k, NFData v) => NFData (LinkedHashMap k v) |
Construction
empty :: LinkedHashMap k v Source
O(1) Construct an empty map.
singleton :: (Eq k, Hashable k) => k -> v -> LinkedHashMap k v Source
O(1) Construct a map with a single element.
Basic interface
size :: LinkedHashMap k v -> Int Source
O(1) Return the number of key-value mappings in this map.
lookup :: (Eq k, Hashable k) => k -> LinkedHashMap k v -> Maybe v Source
O(log n) Return the value to which the specified key is mapped,
or Nothing
if this map contains no mapping for the key.
:: (Eq k, Hashable k) | |
=> v | Default value to return. |
-> k | |
-> LinkedHashMap k v | |
-> v |
O(log n) Return the value to which the specified key is mapped, or the default value if this map contains no mapping for the key.
(!) :: (Eq k, Hashable k) => LinkedHashMap k v -> k -> v Source
O(log n) Return the value to which the specified key is mapped.
Calls error
if this map contains no mapping for the key.
insert :: (Eq k, Hashable k) => k -> v -> LinkedHashMap k v -> LinkedHashMap k v Source
O(log n) Associate the specified value with the specified key in this map. If this map previously contained a mapping for the key, the old value is replaced.
delete :: (Eq k, Hashable k) => k -> LinkedHashMap k v -> LinkedHashMap k v Source
O(log n) Remove the mapping for the specified key from this map if present.
Combine
Union
Transformations
map :: (a -> b) -> [a] -> [b]
map
f xs
is the list obtained by applying f
to each element
of xs
, i.e.,
map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn] map f [x1, x2, ...] == [f x1, f x2, ...]
Difference and intersection
Folds
Filter
Conversions
keys :: (Eq k, Hashable k) => LinkedHashMap k v -> [k] Source
O(n) Return a list of this map's keys. The list is produced lazily.
elems :: (Eq k, Hashable k) => LinkedHashMap k v -> [v] Source
O(n) Return a list of this map's values. The list is produced lazily.
Lists
toList :: LinkedHashMap k v -> [(k, v)] Source
O(n) Return a list of this map's elements. The list is produced lazily.
fromList :: (Eq k, Hashable k) => [(k, v)] -> LinkedHashMap k v Source
O(n*log n) Construct a map with the supplied mappings. If the list contains duplicate mappings, the later mappings take precedence.
pack :: (Eq k, Hashable k) => LinkedHashMap k v -> LinkedHashMap k v Source