summaryrefslogtreecommitdiff
path: root/lambda-calcul/haskell/src/Minilang/REPL/Run.hs
diff options
context:
space:
mode:
authorArnaud Bailly <arnaud@pankzsoft.com>2025-11-02 21:35:19 +0100
committerArnaud Bailly <arnaud@pankzsoft.com>2025-11-02 21:35:19 +0100
commitfc00cff556372e914d3cf15c39700b4ff7c3541c (patch)
tree52a66d4e02a6f22748331b7eee72892e378a548b /lambda-calcul/haskell/src/Minilang/REPL/Run.hs
parent1294be22324f012e96fd1b9d5935563505c080be (diff)
downloadlambda-nantes-fc00cff556372e914d3cf15c39700b4ff7c3541c.tar.gz
better rendering for type errors and evaluation
Diffstat (limited to 'lambda-calcul/haskell/src/Minilang/REPL/Run.hs')
-rw-r--r--lambda-calcul/haskell/src/Minilang/REPL/Run.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/lambda-calcul/haskell/src/Minilang/REPL/Run.hs b/lambda-calcul/haskell/src/Minilang/REPL/Run.hs
index c90ecde..9c31987 100644
--- a/lambda-calcul/haskell/src/Minilang/REPL/Run.hs
+++ b/lambda-calcul/haskell/src/Minilang/REPL/Run.hs
@@ -16,6 +16,7 @@ import Minilang.Lambda.Eval (newEnv)
import Minilang.Lambda.Infer (infer, newContext)
import Minilang.Lambda.Parser (desugar, parse)
import Minilang.REPL.Types
+import qualified Minilang.Lambda.Infer as Infer
-- | Run a REPL session
runREPL ::
@@ -41,7 +42,7 @@ handleUserInput txt = do
Right expr -> do
let term = desugar expr
case infer term of
- Left typeError -> output (Msg $ pack $ show typeError)
+ Left typeError -> output (Msg $ Infer.render typeError)
Right typ -> do
let v = fromDeBruijn $ eval (toDeBruijn term)
output (Evaluated v typ)