From 4ce29a476f2f02448db865787b55037b7b10da69 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Tue, 20 Oct 2009 12:48:53 -0400 Subject: Start of user management --- lib/ur/basis.urs | 14 +++++++------- lib/ur/top.ur | 4 ++-- lib/ur/top.urs | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'lib') diff --git a/lib/ur/basis.urs b/lib/ur/basis.urs index 9ddae8fe..7c3c0969 100644 --- a/lib/ur/basis.urs +++ b/lib/ur/basis.urs @@ -594,25 +594,25 @@ val img : bodyTag ([Src = url, Onabort = transaction unit, Onerror = transaction Onload = transaction unit] ++ boxEvents) val form : ctx ::: {Unit} -> bind ::: {Type} - -> [[Body] ~ ctx] => - xml form [] bind + -> [[Body, Form] ~ ctx] => + xml ([Body, Form] ++ ctx) [] bind -> xml ([Body] ++ ctx) [] [] val subform : ctx ::: {Unit} -> use ::: {Type} -> bind ::: {Type} -> [[Form] ~ ctx] => nm :: Name -> [[nm] ~ use] => - xml form [] bind + xml ([Form] ++ ctx) [] bind -> xml ([Form] ++ ctx) use [nm = $bind] val subforms : ctx ::: {Unit} -> use ::: {Type} -> bind ::: {Type} - -> [[Form] ~ ctx] => + -> [[Form, Subform] ~ ctx] => nm :: Name -> [[nm] ~ use] => - xml subform [Entry = $bind] [] + xml ([Subform] ++ ctx) [Entry = $bind] [] -> xml ([Form] ++ ctx) use [nm = list ($bind)] val entry : ctx ::: {Unit} -> bind ::: {Type} - -> [[Subform] ~ ctx] => - xml form [] bind + -> [[Subform, Form] ~ ctx] => + xml ([Form] ++ ctx) [] bind -> xml ([Subform] ++ ctx) [Entry = $bind] [] con formTag = fn (ty :: Type) (inner :: {Unit}) (attrs :: {Type}) => diff --git a/lib/ur/top.ur b/lib/ur/top.ur index 6ffc888f..6a0f8751 100644 --- a/lib/ur/top.ur +++ b/lib/ur/top.ur @@ -216,10 +216,10 @@ fun queryI [tables ::: {{Type}}] [exps ::: {Type}] (fn fs _ => f fs) () -fun queryX [tables ::: {{Type}}] [exps ::: {Type}] [ctx ::: {Unit}] +fun queryX [tables ::: {{Type}}] [exps ::: {Type}] [ctx ::: {Unit}] [inp ::: {Type}] [tables ~ exps] (q : sql_query tables exps) (f : $(exps ++ map (fn fields :: {Type} => $fields) tables) - -> xml ctx [] []) = + -> xml ctx inp []) = query q (fn fs acc => return {acc}{f fs}) diff --git a/lib/ur/top.urs b/lib/ur/top.urs index 82090dd2..b6734cd3 100644 --- a/lib/ur/top.urs +++ b/lib/ur/top.urs @@ -125,12 +125,12 @@ val queryI : tables ::: {{Type}} -> exps ::: {Type} -> transaction unit) -> transaction unit -val queryX : tables ::: {{Type}} -> exps ::: {Type} -> ctx ::: {Unit} +val queryX : tables ::: {{Type}} -> exps ::: {Type} -> ctx ::: {Unit} -> inp ::: {Type} -> [tables ~ exps] => sql_query tables exps -> ($(exps ++ map (fn fields :: {Type} => $fields) tables) - -> xml ctx [] []) - -> transaction (xml ctx [] []) + -> xml ctx inp []) + -> transaction (xml ctx inp []) val queryX' : tables ::: {{Type}} -> exps ::: {Type} -> ctx ::: {Unit} -> [tables ~ exps] => -- cgit v1.2.3