Hoogle Search
Within LTS Haskell 24.28 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
fromList :: Ord key => Maybe Integer -> [(key, val)] -> LRU key vallrucache Data.Cache.LRU Build a new LRU from the given maximum size and list of contents, in order from most recently accessed to least recently accessed.
toList :: Ord key => LRU key val -> [(key, val)]lrucache Data.Cache.LRU Retrieve a list view of an LRU. The items are returned in order from most recently accessed to least recently accessed.
fromList :: Ord key => Maybe Integer -> [(key, val)] -> IO (AtomicLRU key val)lrucache Data.Cache.LRU.IO Build a new LRU from the optional maximum size and list of contents. See fromList for the semantics.
toList :: Ord key => AtomicLRU key val -> IO [(key, val)]lrucache Data.Cache.LRU.IO Retrieve a list view of an AtomicLRU. See toList for the semantics.
fromList :: Ord key => Maybe Integer -> [(key, val)] -> IO (AtomicLRU key val)lrucache Data.Cache.LRU.IO.Internal Build a new LRU from the optional maximum size and list of contents. See fromList for the semantics.
toList :: Ord key => AtomicLRU key val -> IO [(key, val)]lrucache Data.Cache.LRU.IO.Internal Retrieve a list view of an AtomicLRU. See toList for the semantics.
fromList :: Ord key => Maybe Integer -> [(key, val)] -> LRU key vallrucache Data.Cache.LRU.Internal Build a new LRU from the given maximum size and list of contents, in order from most recently accessed to least recently accessed.
toList :: Ord key => LRU key val -> [(key, val)]lrucache Data.Cache.LRU.Internal Retrieve a list view of an LRU. The items are returned in order from most recently accessed to least recently accessed.
fromList :: (Ord k, MonoidNull v) => [(k, v)] -> MonoidMap k vmonoidmap-internal Data.MonoidMap.Internal Constructs a MonoidMap from a list of key-value pairs. If the list contains more than one value for the same key, values are combined together in the order that they appear with the (<>) operator. Satisfies the following property for all possible keys k:
get k (fromList kvs) == foldMap snd (filter ((== k) . fst) kvs)
Satisfies the following round-trip property:fromList (toList m) == m
Examples
With String values:>>> fromList [(1,"a"), (2,"x"), (1,"b"), (2,"y"), (1,"c"), (2,"z")] fromList [(1,"abc"), (2,"xyz")]
fromListWith :: (Ord k, MonoidNull v) => (v -> v -> v) -> [(k, v)] -> MonoidMap k vmonoidmap-internal Data.MonoidMap.Internal Constructs a MonoidMap from a list of key-value pairs, with a combining function for values. If the list contains more than one value for the same key, values are combined together in the order that they appear with the given combining function. Satisfies the following property for all possible keys k:
get k (fromListWith f kvs) == maybe mempty (foldl1 f) (nonEmpty (snd <$> filter ((== k) . fst) kvs))