Mercurial > urweb
diff demo/more/conference.urs @ 1001:1d456a06ea4e
Add tuple pattern-matching at the constructor level
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 20 Oct 2009 10:19:00 -0400 |
parents | |
children | 61c30f0742d7 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/demo/more/conference.urs Tue Oct 20 10:19:00 2009 -0400 @@ -0,0 +1,20 @@ +con reviewMeta = fn (db :: Type, widget :: Type) => + {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} + +val int : reviewMeta (int, string) +val float : reviewMeta (float, string) +val string : reviewMeta (string, string) +val bool : reviewMeta (bool, bool) + +functor Make(M : sig + con review :: {(Type * Type)} + val review : $(map reviewMeta review) + end) : sig + + val main : unit -> transaction page + +end