mirror of
https://github.com/github/semantic.git
synced 2025-01-03 04:51:57 +03:00
Define unCache as a function rather than a field selector.
This commit is contained in:
parent
03bf5998c7
commit
19468dfcd5
@ -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'.
|
||||
|
Loading…
Reference in New Issue
Block a user