From fc00cff556372e914d3cf15c39700b4ff7c3541c Mon Sep 17 00:00:00 2001 From: Arnaud Bailly Date: Sun, 2 Nov 2025 21:35:19 +0100 Subject: better rendering for type errors and evaluation --- lambda-calcul/haskell/test/Minilang/REPLSpec.hs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lambda-calcul/haskell/test/Minilang') diff --git a/lambda-calcul/haskell/test/Minilang/REPLSpec.hs b/lambda-calcul/haskell/test/Minilang/REPLSpec.hs index 4eb3f4d..f6279c1 100644 --- a/lambda-calcul/haskell/test/Minilang/REPLSpec.hs +++ b/lambda-calcul/haskell/test/Minilang/REPLSpec.hs @@ -23,6 +23,19 @@ spec = parallel $ "y : b" ] + it "defaults to try to typecheck terms" $ do + let out = + withInput + [ "(let ((Succ (lam (n z s) (s n))) \ + \ (Zero (lam (z s) z))) \ + \ (Succ (Succ Zero)))" + ] + + out + `shouldBe` [ "Bye!", + "Cannot unify type variable f with type (e -> f -> e) -> e due to circularity: The variable already occurs in the type." + ] + it "shows error when trying to load a non-existent file" $ do withInput [":load foo"] `shouldBe` [ "Bye!", -- cgit v1.3.1