comparison lib/ur/top.ur @ 1360:02fc16faecf3

[De]serialization of times in JavaScript; proper integer division in JavaScript; Basis.crypt; Top.mkRead'; more aggressive Mono-level inlining, for values of function-y types
author Adam Chlipala <adam@chlipala.net>
date Thu, 23 Dec 2010 17:46:40 -0500
parents 4172863d049d
children 7dd8a6704265
comparison
equal deleted inserted replaced
1359:e525ad571e15 1360:02fc16faecf3
87 "" => Some None 87 "" => Some None
88 | _ => case read s of 88 | _ => case read s of
89 None => None 89 None => None
90 | v => Some v) 90 | v => Some v)
91 91
92 fun txt [t] [ctx ::: {Unit}] [use ::: {Type}] (_ : show t) (v : t) = 92 fun txt [t] [ctx ::: {Unit}] [use ::: {Type}] (_ : show t) (v : t) : xml ctx use [] =
93 cdata (show v) 93 cdata (show v)
94 94
95 fun map0 [K] [tf :: K -> Type] (f : t :: K -> tf t) [r ::: {K}] (fl : folder r) = 95 fun map0 [K] [tf :: K -> Type] (f : t :: K -> tf t) [r ::: {K}] (fl : folder r) =
96 fl [fn r :: {K} => $(map tf r)] 96 fl [fn r :: {K} => $(map tf r)]
97 (fn [nm :: Name] [t :: K] [rest :: {K}] [[nm] ~ rest] acc => 97 (fn [nm :: Name] [t :: K] [rest :: {K}] [[nm] ~ rest] acc =>
341 (e1 : sql_exp tables agg exps (option t)) 341 (e1 : sql_exp tables agg exps (option t))
342 (e2 : option t) = 342 (e2 : option t) =
343 case e2 of 343 case e2 of
344 None => (SQL {e1} IS NULL) 344 None => (SQL {e1} IS NULL)
345 | Some _ => sql_binary sql_eq e1 (sql_inject e2) 345 | Some _ => sql_binary sql_eq e1 (sql_inject e2)
346
347 fun mkRead' [t ::: Type] (f : string -> option t) (name : string) : read t =
348 mkRead (fn s => case f s of
349 None => error <xml>Invalid {txt name}: {txt s}</xml>
350 | Some v => v) f