comparison lib/ur/list.ur @ 995:166ea3944b91

Versioned1 demo working
author Adam Chlipala <adamc@hcoop.net>
date Tue, 06 Oct 2009 17:36:45 -0400
parents b873feb3eb52
children eaba663fd6aa
comparison
equal deleted inserted replaced
994:7932d577cf78 995:166ea3944b91
228 end 228 end
229 229
230 fun mapQuery [tables ::: {{Type}}] [exps ::: {Type}] [t ::: Type] 230 fun mapQuery [tables ::: {{Type}}] [exps ::: {Type}] [t ::: Type]
231 [tables ~ exps] (q : sql_query tables exps) 231 [tables ~ exps] (q : sql_query tables exps)
232 (f : $(exps ++ map (fn fields :: {Type} => $fields) tables) -> t) = 232 (f : $(exps ++ map (fn fields :: {Type} => $fields) tables) -> t) =
233 query q 233 ls <- query q
234 (fn fs acc => return (f fs :: acc)) 234 (fn fs acc => return (f fs :: acc))
235 [] 235 [];
236 return (rev ls)
236 237
237 fun assoc [a] [b] (_ : eq a) (x : a) = 238 fun assoc [a] [b] (_ : eq a) (x : a) =
238 let 239 let
239 fun assoc' (ls : list (a * b)) = 240 fun assoc' (ls : list (a * b)) =
240 case ls of 241 case ls of