summaryrefslogtreecommitdiff
path: root/src/list_util.sml
diff options
context:
space:
mode:
Diffstat (limited to 'src/list_util.sml')
-rw-r--r--src/list_util.sml10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/list_util.sml b/src/list_util.sml
index 7f87b87e..fff3e78e 100644
--- a/src/list_util.sml
+++ b/src/list_util.sml
@@ -29,6 +29,16 @@ structure ListUtil :> LIST_UTIL = struct
structure S = Search
+fun mapConcat f =
+ let
+ fun mc acc ls =
+ case ls of
+ [] => rev acc
+ | h :: t => mc (List.revAppend (f h, acc)) t
+ in
+ mc []
+ end
+
fun mapfold f =
let
fun mf ls s =