From 78d2b3acf77dc0500d27836915dce99a9c368b53 Mon Sep 17 00:00:00 2001 From: Arnaud Bailly Date: Fri, 17 Oct 2025 16:36:40 +0200 Subject: feat: can parse a simple λ-expression MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lambda-calcul/haskell/test/Minilang/Lambda/ParserSpec.hs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lambda-calcul/haskell/test') diff --git a/lambda-calcul/haskell/test/Minilang/Lambda/ParserSpec.hs b/lambda-calcul/haskell/test/Minilang/Lambda/ParserSpec.hs index 4d6f6e0..c1eab27 100644 --- a/lambda-calcul/haskell/test/Minilang/Lambda/ParserSpec.hs +++ b/lambda-calcul/haskell/test/Minilang/Lambda/ParserSpec.hs @@ -10,6 +10,8 @@ spec :: Spec spec = parallel $ do prop "parses an identifier as a variable" $ \(Identifier ident) -> parse ident `shouldBe` Right (Sym ident) + prop "parses a lambda-expression as an abstraction" $ \(Identifier ident) (Identifier body) -> + parse ("(lam (" <> ident <> ") " <> body <> ")") `shouldBe` Right (Abs ident (Sym body)) newtype Identifier = Identifier Text deriving (Eq, Show) -- cgit v1.2.3