Change grammar: only one bind in let and no EAnn for typed syntax
This commit is contained in:
parent
7cedc2e28c
commit
a3e57dde7b
7 changed files with 172 additions and 228 deletions
|
|
@ -1,20 +1,21 @@
|
|||
|
||||
--tripplemagic : Int -> Int -> Int -> Int;
|
||||
--tripplemagic x y z = ((\x:Int. x+x) x) + y + z;
|
||||
--main : Int;
|
||||
--main = tripplemagic ((\x:Int. x+x+3) ((\x:Int. x) 2)) 5 3
|
||||
|
||||
--apply : (Int -> Int) -> Int -> Int;
|
||||
--apply f x = f x;
|
||||
--
|
||||
--main : Int;
|
||||
--main = (\x : Int . x + 5) 5
|
||||
-- tripplemagic : Int -> Int -> Int -> Int;
|
||||
-- tripplemagic x y z = ((\x:Int. x+x) x) + y + z;
|
||||
-- main : Int;
|
||||
-- main = tripplemagic ((\x:Int. x+x+3) ((\x:Int. x) 2)) 5 3
|
||||
-- answer: 22
|
||||
|
||||
-- apply : (Int -> Int) -> Int -> Int;
|
||||
-- apply f x = f x;
|
||||
-- main : Int;
|
||||
-- main = apply (\x : Int . x + 5) 5
|
||||
-- answer: 10
|
||||
|
||||
apply : (Int -> Int -> Int) -> Int -> Int -> Int;
|
||||
apply f x y = f x y;
|
||||
krimp: Int -> Int -> Int;
|
||||
krimp x y = x + y;
|
||||
main : Int;
|
||||
main = apply (krimp) 2 3;--apply (\y: Int . (\x: Int . x + y + 2)) 5 2;
|
||||
main = apply (krimp) 2 3;
|
||||
-- answer: 5
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue