diff options
Diffstat (limited to 'lambda-calcul/haskell/src/Minilang/REPL')
| -rw-r--r-- | lambda-calcul/haskell/src/Minilang/REPL/Run.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lambda-calcul/haskell/src/Minilang/REPL/Run.hs b/lambda-calcul/haskell/src/Minilang/REPL/Run.hs index a98ff41..bf28b23 100644 --- a/lambda-calcul/haskell/src/Minilang/REPL/Run.hs +++ b/lambda-calcul/haskell/src/Minilang/REPL/Run.hs @@ -14,7 +14,7 @@ import Minilang.Lambda.DeBruijn (eval, eval', fromDeBruijn, toDeBruijn) import Minilang.Lambda.Eval (newEnv) import Minilang.Lambda.Infer (infer, newContext) import qualified Minilang.Lambda.Infer as Infer -import Minilang.Lambda.Parser (AST (..), desugar, parse, resugar) +import Minilang.Lambda.Parser (AST (..), desugar, parse, parseProgram, resugar) import Minilang.Lambda.Unify (Type (TyVar)) import Minilang.REPL.Types @@ -95,11 +95,11 @@ loadProgramInEnv :: m () loadProgramInEnv prog = do repl@REPLEnv {env, context, language} <- getEnv - case parse prog of + case parseProgram prog of Left err -> output (Msg $ pack $ show err) - Right e -> do - case loadProgram language e env context of + Right exprs -> do + case loadProgram language env context exprs of Left typeError -> output (Msg $ pack $ show typeError) - Right (term, typ, env', context') -> do + Right (results, env', context') -> do setEnv (repl {env = env', context = context'}) - output (Evaluated (resugar term) term typ) + mapM_ (\(term, typ) -> output (Evaluated (resugar term) term typ)) results |
