chowells79/lrucache — Issue #3: Make API fit canonical use in `Control.Monad.State`
Author: meiersi
Created: 2011-12-11 09:16:10+00:00
State: open

Hi chowells79,

using an LRU cache is an inherently stateful operation. In user code, often a `State` monad is used to provide the necessary operation ordering information. The canonical way to lift your operations to the `State` monad would be to use the `state` operation provided by `Control.Monad.State` (http://hackage.haskell.org/packages/archive/transformers/latest/doc/html/Control-Monad-Trans-State-Lazy.html#v:state). This requires the returned tuple to be of the form `(result, new_state)`. Hence, I suggest changing your functions to return their results in this form.

best regards,
Simon