diff lib/ur/list.ur @ 830:d07980bf1444

Defer pattern-matching exhaustiveness checks and normalize pattern types more thoroughly
author Adam Chlipala <adamc@hcoop.net>
date Sat, 30 May 2009 14:44:29 -0400
parents 78504d97410b
children b2413e4dd109
line wrap: on
line diff
--- a/lib/ur/list.ur	Sat May 30 13:29:00 2009 -0400
+++ b/lib/ur/list.ur	Sat May 30 14:44:29 2009 -0400
@@ -74,6 +74,19 @@
         mapM' []
     end
 
+fun mapXM [m ::: (Type -> Type)] (_ : monad m) [a] [ctx ::: {Unit}] f =
+    let
+        fun mapXM' ls =
+            case ls of
+                [] => return <xml/>
+              | x :: ls =>
+                this <- f x;
+                rest <- mapXM' ls;
+                return <xml>{this}{rest}</xml>
+    in
+        mapXM'
+    end
+
 fun filter [a] f =
     let
         fun fil acc ls =