module Hubris.Collections.LRUCache ( empty , insert ) where import qualified Data.Map as M import Data.Monoid (Sum (..)) type LRUCache a = M.Map a (Sum Int) empty :: LRUCache a empty = M.empty insert :: a -> LRUCache a -> LRUCache a insert = M.alter (fmap $ const 0) where