comparison demo/crud.ur @ 1002:bb3fc575cfe7

Adapted existing demos to tuple pattern-matching
author Adam Chlipala <adamc@hcoop.net>
date Tue, 20 Oct 2009 10:29:17 -0400
parents 74e9e7642f08
children 8d3aa6c7cee0
comparison
equal deleted inserted replaced
1001:1d456a06ea4e 1002:bb3fc575cfe7
1 con colMeta = fn t_formT :: (Type * Type) => { 1 con colMeta = fn (db :: Type, widget :: Type) =>
2 Nam : string, 2 {Nam : string,
3 Show : t_formT.1 -> xbody, 3 Show : db -> xbody,
4 Widget : nm :: Name -> xml form [] [nm = t_formT.2], 4 Widget : nm :: Name -> xml form [] [nm = widget],
5 WidgetPopulated : nm :: Name -> t_formT.1 -> xml form [] [nm = t_formT.2], 5 WidgetPopulated : nm :: Name -> db -> xml form [] [nm = widget],
6 Parse : t_formT.2 -> t_formT.1, 6 Parse : widget -> db,
7 Inject : sql_injectable t_formT.1 7 Inject : sql_injectable db}
8 }
9 con colsMeta = fn cols :: {(Type * Type)} => $(map colMeta cols) 8 con colsMeta = fn cols :: {(Type * Type)} => $(map colMeta cols)
10 9
11 fun default [t] (sh : show t) (rd : read t) (inj : sql_injectable t) 10 fun default [t] (sh : show t) (rd : read t) (inj : sql_injectable t)
12 name : colMeta (t, string) = 11 name : colMeta (t, string) =
13 {Nam = name, 12 {Nam = name,