From 3a94a798557f71cba0fdfdb54cdf431c44a4ef1d Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Tue, 10 Mar 2009 16:38:38 -0400 Subject: BatchG demo --- demo/batchFun.urs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 demo/batchFun.urs (limited to 'demo/batchFun.urs') diff --git a/demo/batchFun.urs b/demo/batchFun.urs new file mode 100644 index 00000000..695576c5 --- /dev/null +++ b/demo/batchFun.urs @@ -0,0 +1,27 @@ +con colMeta = fn t_state :: (Type * Type) => + {Nam : string, + Show : t_state.1 -> xbody, + Inject : sql_injectable t_state.1, + + NewState : transaction t_state.2, + Widget : t_state.2 -> xbody, + ReadState : t_state.2 -> transaction t_state.1} +con colsMeta = fn cols :: {(Type * Type)} => $(map colMeta cols) + +val int : string -> colMeta (int, source string) +val float : string -> colMeta (float, source string) +val string : string -> colMeta (string, source string) + +functor Make(M : sig + con cols :: {(Type * Type)} + constraint [Id] ~ cols + val fl : folder cols + + val tab : sql_table ([Id = int] ++ map fst cols) + + val title : string + + val cols : colsMeta cols + end) : sig + val main : unit -> transaction page +end -- cgit v1.2.3