comparison lib/ur/top.urs @ 2011:cfd604842006

A .urs comment about [queryL*]
author Adam Chlipala <adam@chlipala.net>
date Sat, 03 May 2014 07:59:45 -0400
parents 69daa6d70299
children a3435112b83e
comparison
equal deleted inserted replaced
2010:403f0cc65b9c 2011:cfd604842006
153 -> [[nm] ~ rest] => 153 -> [[nm] ~ rest] =>
154 tf1 t -> tf2 t -> tf3 t -> xml ctx [] []) 154 tf1 t -> tf2 t -> tf3 t -> xml ctx [] [])
155 -> r ::: {K} -> folder r 155 -> r ::: {K} -> folder r
156 -> $(map tf1 r) -> $(map tf2 r) -> $(map tf3 r) -> xml ctx [] [] 156 -> $(map tf1 r) -> $(map tf2 r) -> $(map tf3 r) -> xml ctx [] []
157 157
158 (* Note that the next two functions return elements in the _reverse_ of the natural order!
159 * Such a choice interacts well with the time complexity of standard list operations.
160 * It's easy to regain the natural order by inverting a query's 'ORDER BY' condition. *)
161
158 val queryL : tables ::: {{Type}} -> exps ::: {Type} 162 val queryL : tables ::: {{Type}} -> exps ::: {Type}
159 -> [tables ~ exps] => 163 -> [tables ~ exps] =>
160 sql_query [] [] tables exps 164 sql_query [] [] tables exps
161 -> transaction (list $(exps ++ map (fn fields :: {Type} => $fields) tables)) 165 -> transaction (list $(exps ++ map (fn fields :: {Type} => $fields) tables))
162 166