1
1
mirror of https://github.com/github/semantic.git synced 2024-12-20 21:31:48 +03:00

Define Cell as an associated type family.

This commit is contained in:
Rob Rix 2018-03-14 11:16:23 -04:00
parent 6dd03c72d5
commit 9b53187b8e

View File

@ -23,10 +23,15 @@ newtype Monovariant = Monovariant { unMonovariant :: Name }
deriving (Eq, Ord, Show)
-- | The type into which stored values will be written for a given location type.
type family Cell location = (res :: * -> *) | res -> location
type instance Cell Precise = Latest
type instance Cell Monovariant = Set
class AbstractLocation location where
-- | The type into which stored values will be written for a given location type.
type family Cell location = (res :: * -> *) | res -> location
instance AbstractLocation Precise where
type Cell Precise = Latest
instance AbstractLocation Monovariant where
type Cell Monovariant = Set
-- | A cell holding a single value. Writes will replace any prior value.