Mercurial > urweb
diff demo/crud.urs @ 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 | 1fb318c17546 |
children |
line wrap: on
line diff
--- a/demo/crud.urs Tue Oct 20 10:19:00 2009 -0400 +++ b/demo/crud.urs Tue Oct 20 10:29:17 2009 -0400 @@ -1,11 +1,10 @@ -con colMeta = fn t_formT :: (Type * Type) => +con colMeta = fn (db :: Type, widget :: Type) => {Nam : string, - Show : t_formT.1 -> xbody, - Widget : nm :: Name -> xml form [] [nm = t_formT.2], - WidgetPopulated : nm :: Name -> t_formT.1 - -> xml form [] [nm = t_formT.2], - Parse : t_formT.2 -> t_formT.1, - Inject : sql_injectable t_formT.1} + Show : db -> xbody, + Widget : nm :: Name -> xml form [] [nm = widget], + WidgetPopulated : nm :: Name -> db -> xml form [] [nm = widget], + Parse : widget -> db, + Inject : sql_injectable db} con colsMeta = fn cols :: {(Type * Type)} => $(map colMeta cols) val int : string -> colMeta (int, string)