comparison lib/top.ur @ 469:b393c2fc80f8

About to begin optimization of recursive transaction functions
author Adam Chlipala <adamc@hcoop.net>
date Thu, 06 Nov 2008 17:09:53 -0500
parents dfc8c991abd0
children 7cb418e9714f
comparison
equal deleted inserted replaced
468:4efab85405be 469:b393c2fc80f8
200 -> xml ctx [] []) = 200 -> xml ctx [] []) =
201 query q 201 query q
202 (fn fs acc => return <xml>{acc}{f fs}</xml>) 202 (fn fs acc => return <xml>{acc}{f fs}</xml>)
203 <xml/> 203 <xml/>
204 204
205 fun queryX' (tables ::: {{Type}}) (exps ::: {Type}) (ctx ::: {Unit})
206 (q : sql_query tables exps) [tables ~ exps]
207 (f : $(exps ++ fold (fn nm (fields :: {Type}) acc [[nm] ~ acc] =>
208 [nm = $fields] ++ acc) [] tables)
209 -> transaction (xml ctx [] [])) =
210 query q
211 (fn fs acc =>
212 r <- f fs;
213 return <xml>{acc}{r}</xml>)
214 <xml/>
215
205 fun oneOrNoRows (tables ::: {{Type}}) (exps ::: {Type}) 216 fun oneOrNoRows (tables ::: {{Type}}) (exps ::: {Type})
206 (q : sql_query tables exps) [tables ~ exps] = 217 (q : sql_query tables exps) [tables ~ exps] =
207 query q 218 query q
208 (fn fs _ => return (Some fs)) 219 (fn fs _ => return (Some fs))
209 None 220 None