comparison lib/basis.urs @ 456:1a4fa157fedd

Monoizing FFI transactions correctly
author Adam Chlipala <adamc@hcoop.net>
date Thu, 06 Nov 2008 09:21:34 -0500
parents 222cbc1da232
children f542bc3133dc
comparison
equal deleted inserted replaced
455:d4a81273d4b1 456:1a4fa157fedd
65 val read_int : read int 65 val read_int : read int
66 val read_float : read float 66 val read_float : read float
67 val read_string : read string 67 val read_string : read string
68 val read_bool : read bool 68 val read_bool : read bool
69 val read_time : read time 69 val read_time : read time
70
71
72 (** * Transactions *)
73
74 con transaction :: Type -> Type
75
76 val return : t ::: Type
77 -> t -> transaction t
78 val bind : t1 ::: Type -> t2 ::: Type
79 -> transaction t1 -> (t1 -> transaction t2)
80 -> transaction t2
81
82
83 (** HTTP operations *)
84
85 val requestHeader : string -> transaction (option string)
70 86
71 87
72 (** SQL *) 88 (** SQL *)
73 89
74 con sql_table :: {Type} -> Type 90 con sql_table :: {Type} -> Type
230 -> sql_nfunc t -> sql_exp tables agg exps t 246 -> sql_nfunc t -> sql_exp tables agg exps t
231 val sql_current_timestamp : sql_nfunc time 247 val sql_current_timestamp : sql_nfunc time
232 248
233 249
234 (*** Executing queries *) 250 (*** Executing queries *)
235
236 con transaction :: Type -> Type
237 val return : t ::: Type
238 -> t -> transaction t
239 val bind : t1 ::: Type -> t2 ::: Type
240 -> transaction t1 -> (t1 -> transaction t2)
241 -> transaction t2
242 251
243 val query : tables ::: {{Type}} -> exps ::: {Type} 252 val query : tables ::: {{Type}} -> exps ::: {Type}
244 -> fn [tables ~ exps] => 253 -> fn [tables ~ exps] =>
245 state ::: Type 254 state ::: Type
246 -> sql_query tables exps 255 -> sql_query tables exps