From 7da52fb9413e5caa334f9f3cde809f85a94b5d54 Mon Sep 17 00:00:00 2001 From: pimjager Date: Wed, 13 Apr 2016 19:52:24 +0200 Subject: [PATCH] Function parameters --- examples/StmtEx.spl | 4 ++-- sem.icl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/StmtEx.spl b/examples/StmtEx.spl index d52e5b7..ef8cb88 100644 --- a/examples/StmtEx.spl +++ b/examples/StmtEx.spl @@ -16,10 +16,10 @@ facR(n) :: Int -> Int { return 5; } -test(n) :: Int -> Bool { +test(e) :: Int -> Bool { var i = 0; facR(z); - while (n < 3) { + while (e < 3) { return True; } } diff --git a/sem.icl b/sem.icl index addadad..603d53a 100644 --- a/sem.icl +++ b/sem.icl @@ -49,7 +49,7 @@ semFunDecl fd=:(FunDecl p f args mt vds stmts) = (case mt of Nothing = let t = IdType f in putIdent f t >>| pure t Just t = putIdent f t >>| pure t) >>= \ft -> - mapM_ (\a-> putIdent a (IdType <$> freshIdent)) args >>| + mapM_ (\a-> freshIdent >>= \fr-> putIdent a (IdType fr)) args >>| mapM_ semVarDecl vds >>| mapM_ (checkStmt $ resultType ft) stmts >>| restoreGamma gamma >>| pure fd -- 2.20.1