-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Persistent LinkedHashMap data structure -- @package linkedhashmap @version 0.1.0.0 module Data.LinkedHashMap.IntMap data LinkedHashMap k v LinkedHashMap :: (HashMap k (Entry v)) -> (IntMap (k, v)) -> (IORef Int) -> LinkedHashMap k v -- | O(1) Construct an empty map. empty :: LinkedHashMap k v -- | O(1) Construct a map with a single element. singleton :: (Eq k, Hashable k) => k -> v -> LinkedHashMap k v -- | O(1) Return True if this map is empty, False -- otherwise. null :: LinkedHashMap k v -> Bool -- | O(1) Return the number of key-value mappings in this map. size :: LinkedHashMap k v -> Int -- | O(log n) Return True if the specified key is present in -- the map, False otherwise. member :: (Eq k, Hashable k) => k -> LinkedHashMap k a -> Bool -- | O(log n) Return the value to which the specified key is mapped, -- or Nothing if this map contains no mapping for the key. lookup :: (Eq k, Hashable k) => k -> LinkedHashMap k v -> Maybe 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. lookupDefault :: (Eq k, Hashable k) => v -> k -> LinkedHashMap k v -> v -- | O(log n) Return the value to which the specified key is mapped. -- Calls error if this map contains no mapping for the key. (!) :: (Eq k, Hashable k) => LinkedHashMap k v -> k -> v -- | 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. insert :: (Eq k, Hashable k) => k -> v -> LinkedHashMap k v -> LinkedHashMap k v -- | O(log n) Remove the mapping for the specified key from this map -- if present. delete :: (Eq k, Hashable k) => k -> LinkedHashMap k v -> LinkedHashMap k v -- | 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, ...]
--   
map :: (a -> b) -> [a] -> [b] -- | O(n) Return a list of this map's keys. The list is produced -- lazily. keys :: (Eq k, Hashable k) => LinkedHashMap k v -> [k] -- | O(n) Return a list of this map's values. The list is produced -- lazily. elems :: (Eq k, Hashable k) => LinkedHashMap k v -> [v] -- | O(n) Return a list of this map's elements. toList :: LinkedHashMap k v -> [(k, v)] -- | O(n*log n) Construct a map with the supplied mappings. If the -- list contains duplicate mappings, the later mappings take precedence. fromList :: (Eq k, Hashable k) => [(k, v)] -> LinkedHashMap k v instance Show a => Show (Entry a) instance (NFData k, NFData v) => NFData (LinkedHashMap k v) instance NFData a => NFData (Entry a) instance (Show k, Show v) => Show (LinkedHashMap k v) instance Eq a => Eq (Entry a) module Data.LinkedHashMap.Seq data LinkedHashMap k v LinkedHashMap :: (HashMap k (Entry v)) -> (Seq (Maybe (k, v))) -> !Int -> LinkedHashMap k v -- | O(1) Construct an empty map. empty :: LinkedHashMap k v -- | O(1) Construct a map with a single element. singleton :: (Eq k, Hashable k) => k -> v -> LinkedHashMap k v -- | O(1) Return True if this map is empty, False -- otherwise. null :: LinkedHashMap k v -> Bool -- | O(1) Return the number of key-value mappings in this map. size :: LinkedHashMap k v -> Int -- | O(log n) Return True if the specified key is present in -- the map, False otherwise. member :: (Eq k, Hashable k) => k -> LinkedHashMap k a -> Bool -- | O(log n) Return the value to which the specified key is mapped, -- or Nothing if this map contains no mapping for the key. lookup :: (Eq k, Hashable k) => k -> LinkedHashMap k v -> Maybe 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. lookupDefault :: (Eq k, Hashable k) => v -> k -> LinkedHashMap k v -> v -- | O(log n) Return the value to which the specified key is mapped. -- Calls error if this map contains no mapping for the key. (!) :: (Eq k, Hashable k) => LinkedHashMap k v -> k -> v -- | 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. insert :: (Eq k, Hashable k) => k -> v -> LinkedHashMap k v -> LinkedHashMap k v -- | O(log n) Remove the mapping for the specified key from this map -- if present. delete :: (Eq k, Hashable k) => k -> LinkedHashMap k v -> LinkedHashMap k v -- | 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, ...]
--   
map :: (a -> b) -> [a] -> [b] -- | O(n) Return a list of this map's keys. The list is produced -- lazily. keys :: (Eq k, Hashable k) => LinkedHashMap k v -> [k] -- | O(n) Return a list of this map's values. The list is produced -- lazily. elems :: (Eq k, Hashable k) => LinkedHashMap k v -> [v] -- | O(n) Return a list of this map's elements. The list is produced -- lazily. toList :: LinkedHashMap k v -> [(k, v)] -- | O(n*log n) Construct a map with the supplied mappings. If the -- list contains duplicate mappings, the later mappings take precedence. fromList :: (Eq k, Hashable k) => [(k, v)] -> LinkedHashMap k v pack :: (Eq k, Hashable k) => LinkedHashMap k v -> LinkedHashMap k v instance Show a => Show (Entry a) instance (NFData k, NFData v) => NFData (LinkedHashMap k v) instance NFData a => NFData (Entry a) instance (Show k, Show v) => Show (LinkedHashMap k v) instance Eq a => Eq (Entry a) module Data.LinkedHashSet -- | A set of values. A set cannot contain duplicate values. data LinkedHashSet a -- | O(1) Construct an empty set. empty :: LinkedHashSet a -- | O(1) Construct a set with a single element. singleton :: (Eq a, Hashable a) => a -> LinkedHashSet a -- | O(1) Return True if this set is empty, False -- otherwise. null :: LinkedHashSet a -> Bool -- | O(1) Return the number of elements in this set. size :: LinkedHashSet a -> Int -- | O(min(n,W)) Return True if the given value is present in -- this set, False otherwise. member :: (Eq a, Hashable a) => a -> LinkedHashSet a -> Bool -- | O(min(n,W)) Add the specified value to this set. insert :: (Eq a, Hashable a) => a -> LinkedHashSet a -> LinkedHashSet a -- | O(min(n,W)) Remove the specified value from this set if -- present. delete :: (Eq a, Hashable a) => a -> LinkedHashSet a -> LinkedHashSet a -- | O(n) Return a list of this set's elements. The list is produced -- lazily. toList :: LinkedHashSet a -> [a] -- | O(n*min(W, n)) Construct a set from a list of elements. fromList :: (Eq a, Hashable a) => [a] -> LinkedHashSet a instance NFData a => NFData (LinkedHashSet a) instance Show a => Show (LinkedHashSet a) module Data.LinkedHashMap