diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/basis.urs | 3 | ||||
-rw-r--r-- | lib/top.ur | 11 | ||||
-rw-r--r-- | lib/top.urs | 8 |
3 files changed, 22 insertions, 0 deletions
diff --git a/lib/basis.urs b/lib/basis.urs index f68bedee..daefe954 100644 --- a/lib/basis.urs +++ b/lib/basis.urs @@ -374,7 +374,10 @@ val h1 : bodyTag [] val h2 : bodyTag [] val h3 : bodyTag [] val h4 : bodyTag [] + val li : bodyTag [] +val ol : bodyTag [] +val ul : bodyTag [] val hr : bodyTag [] @@ -202,6 +202,17 @@ fun queryX (tables ::: {{Type}}) (exps ::: {Type}) (ctx ::: {Unit}) (fn fs acc => return <xml>{acc}{f fs}</xml>) <xml/> +fun queryX' (tables ::: {{Type}}) (exps ::: {Type}) (ctx ::: {Unit}) + (q : sql_query tables exps) [tables ~ exps] + (f : $(exps ++ fold (fn nm (fields :: {Type}) acc [[nm] ~ acc] => + [nm = $fields] ++ acc) [] tables) + -> transaction (xml ctx [] [])) = + query q + (fn fs acc => + r <- f fs; + return <xml>{acc}{r}</xml>) + <xml/> + fun oneOrNoRows (tables ::: {{Type}}) (exps ::: {Type}) (q : sql_query tables exps) [tables ~ exps] = query q diff --git a/lib/top.urs b/lib/top.urs index d52ec9d7..6653db07 100644 --- a/lib/top.urs +++ b/lib/top.urs @@ -141,6 +141,14 @@ val queryX : tables ::: {{Type}} -> exps ::: {Type} -> ctx ::: {Unit} -> xml ctx [] []) -> transaction (xml ctx [] []) +val queryX' : tables ::: {{Type}} -> exps ::: {Type} -> ctx ::: {Unit} + -> sql_query tables exps + -> fn [tables ~ exps] => + ($(exps ++ fold (fn nm (fields :: {Type}) acc [[nm] ~ acc] => + [nm = $fields] ++ acc) [] tables) + -> transaction (xml ctx [] [])) + -> transaction (xml ctx [] []) + val oneOrNoRows : tables ::: {{Type}} -> exps ::: {Type} -> sql_query tables exps -> fn [tables ~ exps] => |