summaryrefslogtreecommitdiff
path: root/lambda-calcul/haskell/test/Minilang
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/test/Minilang
parent1294be22324f012e96fd1b9d5935563505c080be (diff)
downloadlambda-nantes-fc00cff556372e914d3cf15c39700b4ff7c3541c.tar.gz
better rendering for type errors and evaluation
Diffstat (limited to 'lambda-calcul/haskell/test/Minilang')
-rw-r--r--lambda-calcul/haskell/test/Minilang/REPLSpec.hs13
1 files changed, 13 insertions, 0 deletions
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!",