From d940187fd8720e0ab3c00e5a6a7ae8f181c7752d Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Sun, 12 Feb 2023 15:37:25 -0800 Subject: Add lambda functions. --- format.sml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 format.sml (limited to 'format.sml') diff --git a/format.sml b/format.sml new file mode 100644 index 0000000..98e8230 --- /dev/null +++ b/format.sml @@ -0,0 +1,7 @@ +structure Format = +struct + fun listToString (show : 'a -> string) (l : 'a list) = + "[" ^ String.concatWith ", " (map show l) ^ "]" + + fun pairToString showA showB (a, b) = "(" ^ showA a ^ ", " ^ showB b ^ ")" +end -- cgit v1.3.1