diff --git a/src/Data/Abstract/Address.hs b/src/Data/Abstract/Address.hs index 75bb12867..aa20ddc20 100644 --- a/src/Data/Abstract/Address.hs +++ b/src/Data/Abstract/Address.hs @@ -4,33 +4,6 @@ module Data.Abstract.Address , Monovariant (..) ) where -import Data.Abstract.Module (ModuleInfo) -import Data.Abstract.Name -import Data.Abstract.Package (PackageInfo) -import Data.Span -import Prologue - --- | 'Precise' models precise store semantics where only the 'Latest' value is taken. Everything gets it's own address (always makes a new allocation) which makes for a larger store. -newtype Precise = Precise { unPrecise :: Int } - deriving (Eq, Ord) - -instance Show Precise where - showsPrec d = showsUnaryWith showsPrec "Precise" d . unPrecise - - --- | 'Monovariant' models using one address for a particular name. It trackes the set of values that a particular address takes and uses it's name to lookup in the store and only allocation if new. -newtype Monovariant = Monovariant { unMonovariant :: Name } - deriving (Eq, Ord) - -instance Show Monovariant where - showsPrec d = showsUnaryWith showsPrec "Monovariant" d . unMonovariant - - -data Located address = Located - { address :: address - , addressPackage :: {-# UNPACK #-} !PackageInfo - , addressModule :: !ModuleInfo - , addressName :: Name - , addressSpan :: Span - } - deriving (Eq, Ord, Show) +import Data.Abstract.Address.Located +import Data.Abstract.Address.Monovariant +import Data.Abstract.Address.Precise diff --git a/src/Data/Abstract/Address/Located.hs b/src/Data/Abstract/Address/Located.hs index e22d495b6..4e2d4e50f 100644 --- a/src/Data/Abstract/Address/Located.hs +++ b/src/Data/Abstract/Address/Located.hs @@ -1 +1,17 @@ -module Data.Abstract.Address.Located where +module Data.Abstract.Address.Located +( Located(..) +) where + +import Data.Abstract.Module (ModuleInfo) +import Data.Abstract.Name +import Data.Abstract.Package (PackageInfo) +import Data.Span + +data Located address = Located + { address :: address + , addressPackage :: {-# UNPACK #-} !PackageInfo + , addressModule :: !ModuleInfo + , addressName :: Name + , addressSpan :: Span + } + deriving (Eq, Ord, Show) diff --git a/src/Data/Abstract/Address/Monovariant.hs b/src/Data/Abstract/Address/Monovariant.hs index 95fc202bc..9d052c413 100644 --- a/src/Data/Abstract/Address/Monovariant.hs +++ b/src/Data/Abstract/Address/Monovariant.hs @@ -1 +1,13 @@ -module Data.Abstract.Address.Monovariant where +module Data.Abstract.Address.Monovariant +( Monovariant(..) +) where + +import Data.Abstract.Name +import Prologue + +-- | 'Monovariant' models using one address for a particular name. It trackes the set of values that a particular address takes and uses it's name to lookup in the store and only allocation if new. +newtype Monovariant = Monovariant { unMonovariant :: Name } + deriving (Eq, Ord) + +instance Show Monovariant where + showsPrec d = showsUnaryWith showsPrec "Monovariant" d . unMonovariant diff --git a/src/Data/Abstract/Address/Precise.hs b/src/Data/Abstract/Address/Precise.hs index 0b1020e91..c3cefd1ad 100644 --- a/src/Data/Abstract/Address/Precise.hs +++ b/src/Data/Abstract/Address/Precise.hs @@ -1 +1,12 @@ -module Data.Abstract.Address.Precise where +module Data.Abstract.Address.Precise +( Precise(..) +) where + +import Prologue + +-- | 'Precise' models precise store semantics where only the 'Latest' value is taken. Everything gets it's own address (always makes a new allocation) which makes for a larger store. +newtype Precise = Precise { unPrecise :: Int } + deriving (Eq, Ord) + +instance Show Precise where + showsPrec d = showsUnaryWith showsPrec "Precise" d . unPrecise