annotate demo/crud.urs @ 631:effa7d43aac3

Make folders abstract
author Adam Chlipala <adamc@hcoop.net>
date Tue, 24 Feb 2009 14:04:07 -0500
parents d64533157f40
children 6c4643880df5
rev   line source
adamc@421 1 con colMeta = fn t_formT :: (Type * Type) =>
adamc@421 2 {Nam : string,
adamc@421 3 Show : t_formT.1 -> xbody,
adamc@421 4 Widget : nm :: Name -> xml form [] [nm = t_formT.2],
adamc@421 5 WidgetPopulated : nm :: Name -> t_formT.1
adamc@421 6 -> xml form [] [nm = t_formT.2],
adamc@421 7 Parse : t_formT.2 -> t_formT.1,
adamc@421 8 Inject : sql_injectable t_formT.1}
adamc@622 9 con colsMeta = fn cols :: {(Type * Type)} => $(map colMeta cols)
adamc@421 10
adamc@421 11 val int : string -> colMeta (int, string)
adamc@421 12 val float : string -> colMeta (float, string)
adamc@421 13 val string : string -> colMeta (string, string)
adamc@421 14 val bool : string -> colMeta (bool, bool)
adamc@421 15
adamc@421 16 functor Make(M : sig
adamc@421 17 con cols :: {(Type * Type)}
adamc@421 18 constraint [Id] ~ cols
adamc@622 19 val tab : sql_table ([Id = int] ++ map fstTT cols)
adamc@421 20
adamc@421 21 val title : string
adamc@421 22
adamc@421 23 val cols : colsMeta cols
adamc@421 24 end) : sig
adamc@421 25 val main : unit -> transaction page
adamc@421 26 end