summaryrefslogtreecommitdiffstats
path: root/format.sml
diff options
context:
space:
mode:
authorRose Hogenson <rhogenson@posteo.net>2023-02-12 15:37:25 -0800
committerRose Hogenson <rhogenson@posteo.net>2023-02-12 15:37:25 -0800
commitd940187fd8720e0ab3c00e5a6a7ae8f181c7752d (patch)
tree69df829ae1e7fb9454008920b49db08489d939a6 /format.sml
parent5989629a7951e544ad4656672025a99ecd08c7c9 (diff)
downloadsml-d940187fd8720e0ab3c00e5a6a7ae8f181c7752d.tar.zst
Add lambda functions.
Diffstat (limited to 'format.sml')
-rw-r--r--format.sml7
1 files changed, 7 insertions, 0 deletions
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