From d30cdcfd6a6ca75125c98749a99e1b0166177783 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Thu, 9 Aug 2018 15:41:51 -0400 Subject: [PATCH] :fire: Latest & All. --- src/Data/Abstract/Address.hs | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/src/Data/Abstract/Address.hs b/src/Data/Abstract/Address.hs index 63dfd0892..4f6832957 100644 --- a/src/Data/Abstract/Address.hs +++ b/src/Data/Abstract/Address.hs @@ -2,18 +2,13 @@ module Data.Abstract.Address ( Precise (..) , Located (..) - , Latest (..) - , All (..) , Monovariant (..) ) where import Data.Abstract.Module (ModuleInfo) import Data.Abstract.Name import Data.Abstract.Package (PackageInfo) -import Data.Monoid (Last(..)) -import Data.Semigroup.Reducer import Data.Span -import Data.Set as Set 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. @@ -40,26 +35,3 @@ data Located address = Located , addressSpan :: Span } deriving (Eq, Ord, Show) - - --- | A cell holding a single value. Writes will replace any prior value. --- --- This is equivalent to 'Data.Monoid.Last', but with a 'Show' instance designed to minimize the amount of text we have to scroll past in ghci. -newtype Latest value = Latest { unLatest :: Last value } - deriving (Eq, Foldable, Functor, Lower, Monoid, Semigroup, Ord, Traversable) - -instance Reducer value (Latest value) where - unit = Latest . unit . Just - -instance Show value => Show (Latest value) where - showsPrec d = showsPrec d . getLast . unLatest - - --- | A cell holding all values written to its address. --- --- This is equivalent to 'Set', but with a 'Show' instance designed to minimize the amount of text we have to scroll past in ghci. -newtype All value = All { unAll :: Set value } - deriving (Eq, Foldable, Lower, Monoid, Ord, Reducer value, Semigroup) - -instance Show value => Show (All value) where - showsPrec d = showsPrec d . Set.toList . unAll