From df4332ea489d531caceb88dcc7f31d1c3d7927f3 Mon Sep 17 00:00:00 2001 From: Rob Dockins Date: Thu, 5 Mar 2020 16:53:41 -0800 Subject: [PATCH] Remove unnecessary NFData constraints/instances --- src/Cryptol/Eval/Env.hs | 3 +-- src/Cryptol/Eval/Value.hs | 9 +-------- src/Cryptol/ModuleSystem/Env.hs | 4 +--- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/Cryptol/Eval/Env.hs b/src/Cryptol/Eval/Env.hs index 9ef4d287..a8101f1c 100644 --- a/src/Cryptol/Eval/Env.hs +++ b/src/Cryptol/Eval/Env.hs @@ -27,7 +27,6 @@ import qualified Data.Map.Strict as Map import Data.Semigroup import GHC.Generics (Generic) -import Control.DeepSeq import Prelude () import Prelude.Compat @@ -37,7 +36,7 @@ import Prelude.Compat data GenEvalEnv sym = EvalEnv { envVars :: !(Map.Map Name (Eval (GenValue sym))) , envTypes :: !TypeEnv - } deriving (Generic, NFData) + } deriving Generic instance Semigroup (GenEvalEnv sym) where l <> r = EvalEnv diff --git a/src/Cryptol/Eval/Value.hs b/src/Cryptol/Eval/Value.hs index b31c9a66..be7f65bf 100644 --- a/src/Cryptol/Eval/Value.hs +++ b/src/Cryptol/Eval/Value.hs @@ -93,9 +93,6 @@ lookupSeqMap (UpdateSeqMap m f) i = type SeqValMap = SeqMap () -instance NFData (SeqMap sym) where - rnf x = seq x () - -- | Generate a finite sequence map from a list of values finiteSeqMap :: [Eval (GenValue sym)] -> SeqMap sym finiteSeqMap xs = @@ -203,9 +200,6 @@ data WordValue sym -- 'SeqMap' of bits. deriving (Generic) -deriving instance BitWord sym => NFData (WordValue sym) - - -- | An arbitrarily-chosen number of elements where we switch from a dense -- sequence representation of bit-level words to 'SeqMap' representation. largeBitSize :: Integer @@ -299,7 +293,7 @@ data GenValue sym | VFun (Eval (GenValue sym) -> Eval (GenValue sym)) -- ^ functions | VPoly (TValue -> Eval (GenValue sym)) -- ^ polymorphic values (kind *) | VNumPoly (Nat' -> Eval (GenValue sym)) -- ^ polymorphic values (kind #) - deriving (Generic, NFData) + deriving Generic -- | Force the evaluation of a word value @@ -434,7 +428,6 @@ ppBV opts (BV width i) -- are necessary to define generic evaluator primitives that operate on both concrete -- and symbolic values uniformly. class ( Show (SBit sym), Show (SWord sym), Show (SInteger sym) - , NFData (SBit sym), NFData (SWord sym), NFData (SInteger sym) ) => BitWord sym where type SBit sym :: Type type SWord sym :: Type diff --git a/src/Cryptol/ModuleSystem/Env.hs b/src/Cryptol/ModuleSystem/Env.hs index 49e2b6d0..c6e5fab0 100644 --- a/src/Cryptol/ModuleSystem/Env.hs +++ b/src/Cryptol/ModuleSystem/Env.hs @@ -88,8 +88,6 @@ data ModuleEnv = ModuleEnv } deriving Generic -instance NFData ModuleEnv - -- | Should we run the linter? data CoreLint = NoCoreLint -- ^ Don't run core lint | CoreLint -- ^ Run core lint @@ -347,7 +345,7 @@ data DynamicEnv = DEnv { deNames :: R.NamingEnv , deDecls :: [T.DeclGroup] , deEnv :: EvalEnv - } deriving (Generic, NFData) + } deriving Generic instance Semigroup DynamicEnv where de1 <> de2 = DEnv