From 19468dfcd5121a4030eadd21d347276000363555 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Tue, 15 May 2018 15:21:46 -0400 Subject: [PATCH] Define unCache as a function rather than a field selector. --- src/Data/Abstract/Cache.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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'.