diff tests/unpoly.ur @ 1185:338be96f8533

Undo an Especialize change that turned out to be unecessary
author Adam Chlipala <adamc@hcoop.net>
date Tue, 16 Mar 2010 10:09:01 -0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/unpoly.ur	Tue Mar 16 10:09:01 2010 -0400
@@ -0,0 +1,28 @@
+val current = return (Some "1")
+fun resolve (_ : string) = return (Some "2")
+
+fun checkDeps deps =
+    u <- current;
+    List.foldlM (fn s (good, errs) =>
+                    v' <- resolve s;
+                    case v' of
+                        None =>
+                        return (False, <xml>
+                          {errs}
+                          Unknown library path <tt>{[s]}</tt>.<br/>
+                        </xml>)
+                      | Some v' =>
+                        b <- return True;
+                        if b then
+                            return (good, errs)
+                        else
+                            return (False, <xml>
+                              {errs}
+                              Access denied to <tt>{[s]}</tt>.<br/>
+                            </xml>)) (True, <xml/>) deps
+
+fun main () =
+    p <- checkDeps ("a" :: "b" :: []);
+    return <xml><body>
+      {p.2}
+    </body></xml>