diff --git a/src/Data/Abstract/Cache.hs b/src/Data/Abstract/Cache.hs index 6de20e234..75c42b62b 100644 --- a/src/Data/Abstract/Cache.hs +++ b/src/Data/Abstract/Cache.hs @@ -8,9 +8,12 @@ import Data.Semilattice.Lower import Prologue -- | A map of 'Configuration's to 'Set's of resulting values & 'Heap's. -newtype Cache term location cell value = Cache { unCache :: Monoidal.Map (Configuration term location cell value) (Set (value, Heap location cell value)) } +newtype Cache term location cell value = Cache (Monoidal.Map (Configuration term location cell value) (Set (value, Heap location cell value))) deriving (Eq, Lower, Monoid, Ord, Reducer (Configuration term location cell value, (value, Heap location cell value)), Show, Semigroup) +unCache :: Cache term location cell value -> Monoidal.Map (Configuration term location cell value) (Set (value, Heap location cell value)) +unCache (Cache cache) = cache + type Cacheable term location cell value = (Ord (cell value), Ord location, Ord term, Ord value) -- | Look up the resulting value & 'Heap' for a given 'Configuration'.