summaryrefslogtreecommitdiffstats
path: root/tests/19-list.sml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/19-list.sml')
-rw-r--r--tests/19-list.sml11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/19-list.sml b/tests/19-list.sml
new file mode 100644
index 0000000..52404dc
--- /dev/null
+++ b/tests/19-list.sml
@@ -0,0 +1,11 @@
+infix 6 +
+infixr 5 ::
+
+datatype 'a list = Nil | :: of 'a * 'a list
+
+fun x + y = __builtin "add" (x, y)
+
+fun foldl _ acc Nil = acc
+ | foldl f acc (x :: xs) = foldl f (f (x, acc)) xs
+
+val _ = __builtin "exit" (foldl op + 0 (1 :: 2 :: 3 :: 6 :: 8 :: 10 :: 12 :: Nil))