apart-0.1.3: Get all your structure and rip it apart.

Safe HaskellSafe




type LRU a = Segmented Binary a Source #

In this usage example we'll try to implement LRU cache. This policy discards the least recently used items first, so we need to add priority for the most recently used elements. Very resembles behavoir of Splay trees, actually.

cache :: Ord a => a -> LRU a -> LRU a Source #

Insert sortable value to cache, aftear that, value moved to root