haskell-cache
                                
                                
                                
                                    haskell-cache copied to clipboard
                            
                            
                            
                        Size limitations on Data.Cache instance
I have a certain use case where I am worried about the size of cache instance. Given it is an in memory data store I want to understand why you proceeded with no limit on size of Data.Cache instance.
Also what workaround would you recommend in case I want to restrict the size of cache instance.
The reason I have not implemented size restrictions is because I have not needed any.
if you want size restrictions. You’ll have to maintain the size of the cache to a certain limit when you do the insert operation.
Depending on the eviction policy you’ll need to keep track of additional metadata (e.g a FIFO queue if you’d like to evict the oldest item when inserting into a full cache).
Maybe you might be able to build it around the existing API, since all the STM operations are exposed!