aboutsummaryrefslogtreecommitdiffhomepage
path: root/demo/more/dbgrid.urs
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-09-12 15:08:16 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-09-12 15:08:16 -0400
commit98b889b93a2ab366f002bc0607063e56bb3e6339 (patch)
treeb14cefa940085b1eb1aede8b6027107f444a1fc5 /demo/more/dbgrid.urs
parentde70cef3d6fe87330da885d23830f0bedc9483c7 (diff)
Nullable columns *might* be working, but too much JS is generated for the page to load in finite time
Diffstat (limited to 'demo/more/dbgrid.urs')
-rw-r--r--demo/more/dbgrid.urs19
1 files changed, 15 insertions, 4 deletions
diff --git a/demo/more/dbgrid.urs b/demo/more/dbgrid.urs
index 5f51fcd4..cfbdff89 100644
--- a/demo/more/dbgrid.urs
+++ b/demo/more/dbgrid.urs
@@ -15,13 +15,20 @@ con colMeta = fn (row :: {Type}) (global_t :: (Type * Type)) =>
Handlers : global_t.1 -> colMeta' row global_t.2}
structure Direct : sig
+ con metaBase = fn actual_input :: (Type * Type) =>
+ {Display : actual_input.2 -> xbody,
+ Edit : actual_input.2 -> xbody,
+ Initialize : actual_input.1 -> transaction actual_input.2,
+ Parse : actual_input.2 -> signal (option actual_input.1)}
+
+ datatype metaBoth actual input =
+ NonNull of metaBase (actual, input) * metaBase (option actual, input)
+ | Nullable of metaBase (actual, input)
+
con meta = fn global_actual_input :: (Type * Type * Type) =>
{Initialize : transaction global_actual_input.1,
Handlers : global_actual_input.1
- -> {Display : global_actual_input.3 -> xbody,
- Edit : global_actual_input.3 -> xbody,
- Initialize : global_actual_input.2 -> transaction global_actual_input.3,
- Parse : global_actual_input.3 -> signal (option global_actual_input.2)}}
+ -> metaBoth global_actual_input.2 global_actual_input.3}
con editableState :: (Type * Type * Type) -> (Type * Type)
val editable : ts ::: (Type * Type * Type) -> rest ::: {Type}
@@ -35,6 +42,10 @@ structure Direct : sig
-> colMeta ([nm = ts.2] ++ rest)
(readOnlyState ts)
+ val nullable : global ::: Type -> actual ::: Type -> input ::: Type
+ -> meta (global, actual, input)
+ -> meta (global, option actual, input)
+
type intGlobal
type intInput
val int : meta (intGlobal, int, intInput)