diff src/list_util.sml @ 191:aa54250f58ac

Parametrized datatypes through explify
author Adam Chlipala <adamc@hcoop.net>
date Fri, 08 Aug 2008 10:28:32 -0400
parents 6230bdd122e7
children 73456bfde988
line wrap: on
line diff
--- a/src/list_util.sml	Thu Aug 07 13:09:26 2008 -0400
+++ b/src/list_util.sml	Fri Aug 08 10:28:32 2008 -0400
@@ -146,4 +146,14 @@
         m 0 []
     end
 
+fun foldli f =
+    let
+        fun m i acc ls =
+            case ls of
+                [] => acc
+              | h :: t => m (i + 1) (f (i, h, acc)) t
+    in
+        m 0
+    end
+
 end