diff --git a/maf2-analysis/app/Run/Analyzer.hs b/maf2-analysis/app/Run/Analyzer.hs index 400b5c41..4f8bf775 100644 --- a/maf2-analysis/app/Run/Analyzer.hs +++ b/maf2-analysis/app/Run/Analyzer.hs @@ -4,13 +4,17 @@ module Run.Analyzer(Options, options, main) where import Options.Applicative import Analysis.Scheme.Simple -import Syntax.Scheme import Data.DMap -import Data.Maybe +import qualified Data.DMap as DMap import Text.Printf import Data.HashMap.Strict (HashMap) import qualified Data.HashMap.Strict as Map import Data.List (intercalate) +import Analysis.Monad +import Data.Map (Map) +import qualified Data.Map as Map2 +import Data.Functor.Identity +import Data.Function ((&)) newtype Options = Options String deriving Show diff --git a/maf2-analysis/src/Analysis/Scheme.hs b/maf2-analysis/src/Analysis/Scheme.hs index 24da1c70..b087a0c6 100644 --- a/maf2-analysis/src/Analysis/Scheme.hs +++ b/maf2-analysis/src/Analysis/Scheme.hs @@ -3,8 +3,6 @@ module Analysis.Scheme where import Prelude hiding (exp, lookup) -import Debug.Trace - import Analysis.Scheme.Primitives import qualified Analysis.Scheme.Semantics as Semantics import Analysis.Scheme.Monad (SchemeM) @@ -28,6 +26,7 @@ import Data.Dynamic import Data.Functor.Identity import Data.TypeLevel.Ghost import Data.Functor ((<&>)) +import Analysis.Monad (EnvM(..)) ----------------------------------------- -- Shorthands @@ -182,13 +181,16 @@ instance {-# OVERLAPPING #-} ( instance {-# OVERLAPPING #-} (CtxM m ctx, Monad m, StoreM (CallT var v ctx dep m) var, + EnvM m var (Env var v ctx dep), SchemeAnalysisConstraints var v ctx dep ) => CallM (CallT var v ctx dep m) (Env var v ctx dep) v where - call (Lam _ bdy _, env) = do + call (Lam _ bdy _, _) = do + -- get the extended environment + env' <- CallT $ lift getEnv -- get the current context ctx <- CallT $ lift getCtx -- create a new component from this context - let comp = (bdy, env, ctx, Ghost) + let comp = (bdy, env', ctx, Ghost) -- spawn the new component _ <- CallT $ spawn comp -- lookup the return value of the component