diff --git a/src/Control/Abstract/Evaluator.hs b/src/Control/Abstract/Evaluator.hs index 2e310d692..93992eb73 100644 --- a/src/Control/Abstract/Evaluator.hs +++ b/src/Control/Abstract/Evaluator.hs @@ -52,7 +52,7 @@ earlyReturn = send . Return @address @value catchReturn :: Member (Return address value) effects => Evaluator address value effects a -> (forall x . Return address value x -> Evaluator address value effects a) -> Evaluator address value effects a catchReturn action handler = interpose pure (\ ret _ -> handler ret) action -runReturn :: Effectful (m address value) => m address value (Return address value ': effects) (address) -> m address value effects (address) +runReturn :: Effectful (m address value) => m address value (Return address value ': effects) address -> m address value effects address runReturn = raiseHandler (relay pure (\ (Return value) _ -> pure value)) diff --git a/src/Control/Abstract/Value.hs b/src/Control/Abstract/Value.hs index 3a5e2aace..11ea63f93 100644 --- a/src/Control/Abstract/Value.hs +++ b/src/Control/Abstract/Value.hs @@ -256,4 +256,4 @@ subtermAddress = address <=< subtermRef rvalBox :: Member (Allocator address value) effects => value -> Evaluator address value effects (ValueRef address value) -rvalBox val = Rval <$> (box val) +rvalBox val = Rval <$> box val diff --git a/src/Data/Abstract/Evaluatable.hs b/src/Data/Abstract/Evaluatable.hs index 299421ff9..62cb90d08 100644 --- a/src/Data/Abstract/Evaluatable.hs +++ b/src/Data/Abstract/Evaluatable.hs @@ -88,7 +88,7 @@ evaluatePackageWith :: forall address term value inner inner' inner'' outer , inner' ~ (Reader ModuleInfo ': inner'') , inner'' ~ (Modules address value ': Reader Span ': Reader PackageInfo ': outer) ) - => (SubtermAlgebra Module term (TermEvaluator term address value inner (address)) -> SubtermAlgebra Module term (TermEvaluator term address value inner (address))) + => (SubtermAlgebra Module term (TermEvaluator term address value inner address) -> SubtermAlgebra Module term (TermEvaluator term address value inner address)) -> (SubtermAlgebra (Base term) term (TermEvaluator term address value inner (ValueRef address value)) -> SubtermAlgebra (Base term) term (TermEvaluator term address value inner (ValueRef address value))) -> Package term -> TermEvaluator term address value outer [(address, Environment address)] @@ -123,7 +123,7 @@ evaluatePackageWith analyzeModule analyzeTerm package maybe (pure ptr) ((`call` []) <=< deref <=< variable) sym evalPrelude prelude = raiseHandler (runModules (runTermEvaluator . evalModule emptyEnv)) $ do - (_, builtinsEnv) <- runInModule emptyEnv moduleInfoFromCallStack (TermEvaluator (defineBuiltins *> (box unit))) + (_, builtinsEnv) <- runInModule emptyEnv moduleInfoFromCallStack (TermEvaluator (defineBuiltins *> box unit)) second (mergeEnvs builtinsEnv) <$> evalModule builtinsEnv prelude withPrelude Nothing f = f emptyEnv diff --git a/src/Language/PHP/Syntax.hs b/src/Language/PHP/Syntax.hs index 1ef7040db..eecacfe03 100644 --- a/src/Language/PHP/Syntax.hs +++ b/src/Language/PHP/Syntax.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE DeriveAnyClass, ViewPatterns #-} +{-# LANGUAGE DeriveAnyClass #-} module Language.PHP.Syntax where import Data.Abstract.Evaluatable @@ -213,7 +213,7 @@ instance Show1 NamespaceName where liftShowsPrec = genericLiftShowsPrec instance Evaluatable NamespaceName where eval (NamespaceName xs) = Rval <$> foldl1 f (fmap subtermAddress xs) - where f ns id = evaluateInScopedEnv (ns >>= deref) id + where f ns = evaluateInScopedEnv (ns >>= deref) newtype ConstDeclaration a = ConstDeclaration [a] deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable)