comparison lib/top.ur @ 470:7cb418e9714f

Tree demo works
author Adam Chlipala <adamc@hcoop.net>
date Thu, 06 Nov 2008 18:49:38 -0500
parents b393c2fc80f8
children 20fab0e96217
comparison
equal deleted inserted replaced
469:b393c2fc80f8 470:7cb418e9714f
224 o <- oneOrNoRows q; 224 o <- oneOrNoRows q;
225 return (case o of 225 return (case o of
226 None => error <xml>Query returned no rows</xml> 226 None => error <xml>Query returned no rows</xml>
227 | Some r => r) 227 | Some r => r)
228 228
229 fun eqNullable (tables ::: {{Type}}) (agg ::: {{Type}}) (exps ::: {Type})
230 (t ::: Type) (_ : sql_injectable (option t))
231 (e1 : sql_exp tables agg exps (option t))
232 (e2 : sql_exp tables agg exps (option t)) =
233 (SQL ({[e1]} IS NULL AND {[e2]} IS NULL) OR {[e1]} = {[e2]})
234
235 fun eqNullable' (tables ::: {{Type}}) (agg ::: {{Type}}) (exps ::: {Type})
236 (t ::: Type) (inj : sql_injectable (option t))
237 (e1 : sql_exp tables agg exps (option t))
238 (e2 : option t) =
239 case e2 of
240 None => (SQL {[e1]} IS NULL)
241 | Some _ => sql_comparison sql_eq e1 (@sql_inject inj e2)