Skip to content

Commit de96a67

Browse files
committed
Add test for list reverse
1 parent cbace1c commit de96a67

File tree

8 files changed

+539
-28
lines changed

8 files changed

+539
-28
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
let |> = fun x -> fun f -> f x
2+
let reverse = fun l -> let rec helper = fun l -> fun acc ->
3+
match l as t#a with ([], [], acc)
4+
| ( ::
5+
, [hd, tl]
6+
, (helper tl) (:: ((hd), (acc))) )
7+
in (helper l) []
8+
let head = fun l -> match l as t#b with (::, [hd, tl], hd)
9+
let l1 = :: ((1), (:: ((2), (:: ((3), ([]))))))
10+
let t1 = print_int (head (reverse l1))
11+
let t2 = (|> ((|> (reverse l1)) head)) print_int

lamagraph-compiler/test/golden/core/core/T.lml.core

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../typechecker/source/List.lml

lamagraph-compiler/test/golden/core/source/T.lml

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
33
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../typechecker/source/List.lml

0 commit comments

Comments
 (0)