adamc@1185: val current = return (Some "1") adamc@1185: fun resolve (_ : string) = return (Some "2") adamc@1185: adamc@1185: fun checkDeps deps = adamc@1185: u <- current; adamc@1185: List.foldlM (fn s (good, errs) => adamc@1185: v' <- resolve s; adamc@1185: case v' of adamc@1185: None => adamc@1185: return (False, <xml> adamc@1185: {errs} adamc@1185: Unknown library path <tt>{[s]}</tt>.<br/> adamc@1185: </xml>) adamc@1185: | Some v' => adamc@1185: b <- return True; adamc@1185: if b then adamc@1185: return (good, errs) adamc@1185: else adamc@1185: return (False, <xml> adamc@1185: {errs} adamc@1185: Access denied to <tt>{[s]}</tt>.<br/> adamc@1185: </xml>)) (True, <xml/>) deps adamc@1185: adamc@1185: fun main () = adamc@1185: p <- checkDeps ("a" :: "b" :: []); adamc@1185: return <xml><body> adamc@1185: {p.2} adamc@1185: </body></xml>