comparison demo/more/grid1.ur @ 932:0a156bbd205f

Full Grid1 compiles, thanks to avoiding code size blow-up in mono_reduce
author Adam Chlipala <adamc@hcoop.net>
date Sun, 13 Sep 2009 13:25:09 -0400
parents be6585b4058b
children 2422360c78a3
comparison
equal deleted inserted replaced
931:be6585b4058b 932:0a156bbd205f
6 sequence s 6 sequence s
7 table t : {Id : int, A : int, B : string, C : bool, D : int, E : option int, F : option int} 7 table t : {Id : int, A : int, B : string, C : bool, D : int, E : option int, F : option int}
8 PRIMARY KEY Id, 8 PRIMARY KEY Id,
9 CONSTRAINT Foreign FOREIGN KEY (D) REFERENCES t1(Id) ON DELETE CASCADE 9 CONSTRAINT Foreign FOREIGN KEY (D) REFERENCES t1(Id) ON DELETE CASCADE
10 10
11 (*fun page (n, s) = return <xml>A = {[n]}, B = {[s]}</xml>*) 11 fun page (n, s) = return <xml>A = {[n]}, B = {[s]}</xml>
12 12
13 open Make(struct 13 open Make(struct
14 val tab = t 14 val tab = t
15 con key = [Id = _] 15 con key = [Id = _]
16 16
34 val tab = t1 34 val tab = t1
35 fun render r = r.A 35 fun render r = r.A
36 end) 36 end)
37 37
38 val cols = {Id = Direct.readOnly [#Id] ! "Id" Direct.int, 38 val cols = {Id = Direct.readOnly [#Id] ! "Id" Direct.int,
39 (*A = Direct.editable [#A] ! "A" Direct.int, 39 A = Direct.editable [#A] ! "A" Direct.int,
40 B = Direct.editable [#B] ! "B" Direct.string, 40 B = Direct.editable [#B] ! "B" Direct.string,
41 C = Direct.editable [#C] ! "C" Direct.bool, 41 C = Direct.editable [#C] ! "C" Direct.bool,
42 D = Direct.editable [#D] ! "D" F.meta,*) 42 D = Direct.editable [#D] ! "D" F.meta,
43 E = Direct.editable [#E] ! "E" (Direct.nullable Direct.int), 43 E = Direct.editable [#E] ! "E" (Direct.nullable Direct.int),
44 F = Direct.editable [#F] ! "F" (Direct.nullable F.meta)(*, 44 F = Direct.editable [#F] ! "F" (Direct.nullable F.meta),
45 DA = computed "2A" (fn r => 2 * r.A), 45 DA = computed "2A" (fn r => 2 * r.A),
46 Link = computedHtml "Link" (fn r => <xml><a link={page (r.A, r.B)}>Go</a></xml>)*)} 46 Link = computedHtml "Link" (fn r => <xml><a link={page (r.A, r.B)}>Go</a></xml>)}
47 end) 47 end)
48 48
49 fun main () = 49 fun main () =
50 grid <- grid; 50 grid <- grid;
51 return <xml> 51 return <xml>