summaryrefslogtreecommitdiff
path: root/demo/batchFun.urs
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-03-10 16:38:38 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-03-10 16:38:38 -0400
commit3a94a798557f71cba0fdfdb54cdf431c44a4ef1d (patch)
treec0dff25071f38e045374e6d001ef7356af04e5db /demo/batchFun.urs
parent74f41e27e7940eec0320f7358f030185e8c2c2e0 (diff)
BatchG demo
Diffstat (limited to 'demo/batchFun.urs')
-rw-r--r--demo/batchFun.urs27
1 files changed, 27 insertions, 0 deletions
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