comparison demo/crud.urs @ 421:0767d7ad0c3a

Crud demo
author Adam Chlipala <adamc@hcoop.net>
date Thu, 23 Oct 2008 18:18:51 -0400
parents
children d64533157f40
comparison
equal deleted inserted replaced
420:9119a5920106 421:0767d7ad0c3a
1 con colMeta = fn t_formT :: (Type * Type) =>
2 {Nam : string,
3 Show : t_formT.1 -> xbody,
4 Widget : nm :: Name -> xml form [] [nm = t_formT.2],
5 WidgetPopulated : nm :: Name -> t_formT.1
6 -> xml form [] [nm = t_formT.2],
7 Parse : t_formT.2 -> t_formT.1,
8 Inject : sql_injectable t_formT.1}
9 con colsMeta = fn cols :: {(Type * Type)} => $(mapT2T colMeta cols)
10
11 val int : string -> colMeta (int, string)
12 val float : string -> colMeta (float, string)
13 val string : string -> colMeta (string, string)
14 val bool : string -> colMeta (bool, bool)
15
16 functor Make(M : sig
17 con cols :: {(Type * Type)}
18 constraint [Id] ~ cols
19 val tab : sql_table ([Id = int] ++ mapT2T fstTT cols)
20
21 val title : string
22
23 val cols : colsMeta cols
24 end) : sig
25 val main : unit -> transaction page
26 end