From 8e1e9579da82ef8a709b6a80c9509052f2e74ada Mon Sep 17 00:00:00 2001 From: joshvera Date: Fri, 14 Sep 2018 18:16:54 -0400 Subject: [PATCH] lints --- src/Control/Abstract/ScopeGraph.hs | 2 +- src/Data/Abstract/ScopeGraph.hs | 4 ++-- src/Data/Syntax/Declaration.hs | 2 +- src/Data/Syntax/Statement.hs | 2 +- src/Language/TypeScript/Syntax/TypeScript.hs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Control/Abstract/ScopeGraph.hs b/src/Control/Abstract/ScopeGraph.hs index 69e532d88..86c889d97 100644 --- a/src/Control/Abstract/ScopeGraph.hs +++ b/src/Control/Abstract/ScopeGraph.hs @@ -73,7 +73,7 @@ instance Effect (ScopeEnv address) where runScopeEnv :: (Ord address, Effects effects, Member Fresh effects, Member (Allocator address) effects) => Evaluator address value (ScopeEnv address ': effects) a -> Evaluator address value effects (ScopeGraph address, a) -runScopeEnv evaluator = runState (ScopeGraph.emptyGraph) (reinterpret handleScopeEnv evaluator) +runScopeEnv evaluator = runState ScopeGraph.emptyGraph (reinterpret handleScopeEnv evaluator) handleScopeEnv :: forall address value effects a. (Ord address, Member Fresh effects, Member (Allocator address) effects, Effects effects) => ScopeEnv address (Eff (ScopeEnv address ': effects)) a diff --git a/src/Data/Abstract/ScopeGraph.hs b/src/Data/Abstract/ScopeGraph.hs index a8e2d8899..0908d9961 100644 --- a/src/Data/Abstract/ScopeGraph.hs +++ b/src/Data/Abstract/ScopeGraph.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE GADTs, GeneralizedNewtypeDeriving #-} +{-# LANGUAGE GADTs #-} module Data.Abstract.ScopeGraph ( ScopeGraph(..) , Path @@ -75,7 +75,7 @@ declare declaration ddata assocScope g@ScopeGraph{..} = fromMaybe g $ do scopeKey <- currentScope scope <- lookupScope scopeKey g let newScope = scope { declarations = Map.insert declaration (ddata, assocScope) (declarations scope) } - pure $ g { graph = (Map.insert scopeKey newScope graph) } + pure $ g { graph = Map.insert scopeKey newScope graph } reference :: Ord scope => Reference -> Declaration -> ScopeGraph scope -> ScopeGraph scope reference ref declaration g@ScopeGraph{..} = fromMaybe g $ do diff --git a/src/Data/Syntax/Declaration.hs b/src/Data/Syntax/Declaration.hs index 3d4275c64..b4d02b158 100644 --- a/src/Data/Syntax/Declaration.hs +++ b/src/Data/Syntax/Declaration.hs @@ -215,7 +215,7 @@ instance Evaluatable Class where scope <- associatedScope (Declaration name) (scope,) <$> subtermAddress superclass - let imports = ((I,) <$> (fmap pure . catMaybes $ fst <$> supers)) + let imports = (I,) <$> (fmap pure . catMaybes $ fst <$> supers) current = maybe mempty (fmap (P, ) . pure . pure) currentScope' edges = Map.fromList (imports <> current) childScope <- newScope edges diff --git a/src/Data/Syntax/Statement.hs b/src/Data/Syntax/Statement.hs index d10cd1324..35d67d044 100644 --- a/src/Data/Syntax/Statement.hs +++ b/src/Data/Syntax/Statement.hs @@ -143,7 +143,7 @@ instance Evaluatable Assignment where case lhs of LvalLocal name -> do - case (declaredName (subterm assignmentValue)) of + case declaredName (subterm assignmentValue) of Just rhsName -> do assocScope <- associatedScope (Declaration rhsName) let edges = maybe mempty (Map.singleton I . pure) assocScope diff --git a/src/Language/TypeScript/Syntax/TypeScript.hs b/src/Language/TypeScript/Syntax/TypeScript.hs index af1c39d7b..c39134014 100644 --- a/src/Language/TypeScript/Syntax/TypeScript.hs +++ b/src/Language/TypeScript/Syntax/TypeScript.hs @@ -366,7 +366,7 @@ instance Show1 ExtendsClause where liftShowsPrec = genericLiftShowsPrec instance Evaluatable ExtendsClause where eval ExtendsClause{..} = do -- Evaluate subterms - _ <- traverse subtermRef extendsClauses + traverse_ subtermRef extendsClauses rvalBox unit newtype ArrayType a = ArrayType { arrayType :: a }