From 3a498db5a485a3ed7014e3016c92e0ac64c4b73b Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Sat, 18 May 2024 07:23:38 -0700 Subject: Improve support for infix operators. --- tests/19-list.sml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/19-list.sml (limited to 'tests/19-list.sml') 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)) -- cgit v1.3.1