return;
}
+repeat(f, n) {
+ var x = n;
+ while(x > 0) {
+ f();
+ x = x-1;
+ }
+}
+
main() {
//var f = \x->print(x);
- var z = map(\x->print(3), 1:2:[]);
- var x = print(3);
+ //var z = map(\x->print(3), 1:2:[]);
+ repeat(\->print(0), 5);
//var x = foldr(\x y->x+y, 0, 1:2:[]);
//print(x);
return;
| '[]' <Expr>
| '(' <Expr> ',' <Expr> ')'
| '"' <char> '"'
-<LamdaExpr> ::= '\'<id>+ '->' <Expr>
+<LamdaExpr> ::= '\'<id>* '->' <Expr>
<FieldSels> ::= ('.' ('hd'|'tl'|'fst'|'snd))*
<FunCall> ::= <id> ['(' <ActArgs>+ ')']
<ActArgs> ::= <Expr> [',' ActArgs]
parseLambda :: Parser Token Expr
parseLambda = LambdaExpr <$> peekPos
- <*> (satTok BackslashToken *> some parseIdent)
+ <*> (satTok BackslashToken *> many parseIdent)
<*> (satTok ArrowToken *> parseExpr)
makeStrExpr :: Pos [Char] -> Expr
fresh >>= \(IdType n) ->
let f = ("2lambda_"+++n) in
let fd = FunDecl p f args Nothing [] [ReturnStmt $ Just e] in
- let fe = FunExpr p f [] [] in
+ let fe = VarExpr p (VarDef f []) in
pure ([fd], fe)
unfoldL_ (FunExpr p f es fs) = flattenT <$> mapM unfoldL_ es >>= \(fds, es_)->
pure (fds, FunExpr p f es_ fs)