summaryrefslogtreecommitdiffstats
path: root/tests/190-list.sml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/190-list.sml')
-rw-r--r--tests/190-list.sml10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/190-list.sml b/tests/190-list.sml
new file mode 100644
index 0000000..de69c4a
--- /dev/null
+++ b/tests/190-list.sml
@@ -0,0 +1,10 @@
+infix 6 +
+
+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))