chowells79/lrucache — Issue #4: Change `Maybe Integer` size restriction type to `Int`
Author: meiersi
Created: 2011-12-11 09:24:48+00:00
State: open

Your LRU cache cannot store more than `(maxBound :: Int) - 1` elements, as the corresponding memory requirements would exceed the range of memory that your CPU can address. Hence, you can use a size restriction of `maxBound :: Int` to simulate an unbounded (i.e., memory-bounded) LRU cache. However, I can see only very few use cases of a memory-bounded LRU cache, as I would normally use a LRU cache to *avoid* using all memory.

Therfore, I suggest changing the API to always require a size restriction of type `Int` and tell the user about using `maxBound :: Int`, if he wants a purely memory-bounded instance of the datastructure.