Mercurial > urweb
comparison tests/crud.ur @ 371:782ef3ad8c28
Crud auto-indented correctly
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 16 Oct 2008 16:00:58 -0400 |
parents | 4f75cc2e1373 |
children | 8084fa9216de |
comparison
equal
deleted
inserted
replaced
370:4f75cc2e1373 | 371:782ef3ad8c28 |
---|---|
10 | 10 |
11 fun default (t ::: Type) (sh : show t) (rd : read t) (inj : sql_injectable t) | 11 fun default (t ::: Type) (sh : show t) (rd : read t) (inj : sql_injectable t) |
12 name : colMeta (t, string) = | 12 name : colMeta (t, string) = |
13 {Nam = name, | 13 {Nam = name, |
14 Show = txt _, | 14 Show = txt _, |
15 Widget = fn nm :: Name => (<xml><textbox{nm}/></xml>), | 15 Widget = fn nm :: Name => <xml><textbox{nm}/></xml>, |
16 WidgetPopulated = fn (nm :: Name) n => | 16 WidgetPopulated = fn (nm :: Name) n => |
17 (<xml><textbox{nm} value={show _ n}/></xml>), | 17 <xml><textbox{nm} value={show _ n}/></xml>, |
18 Parse = readError _, | 18 Parse = readError _, |
19 Inject = _} | 19 Inject = _} |
20 | 20 |
21 val int = default _ _ _ | 21 val int = default _ _ _ |
22 val float = default _ _ _ | 22 val float = default _ _ _ |
23 val string = default _ _ _ | 23 val string = default _ _ _ |
24 | 24 |
25 fun bool name = {Nam = name, | 25 fun bool name = {Nam = name, |
26 Show = txt _, | 26 Show = txt _, |
27 Widget = fn nm :: Name => (<xml><checkbox{nm}/></xml>), | 27 Widget = fn nm :: Name => <xml><checkbox{nm}/></xml>, |
28 WidgetPopulated = fn (nm :: Name) b => | 28 WidgetPopulated = fn (nm :: Name) b => |
29 (<xml><checkbox{nm} checked={b}/></xml>), | 29 <xml><checkbox{nm} checked={b}/></xml>, |
30 Parse = fn x => x, | 30 Parse = fn x => x, |
31 Inject = _} | 31 Inject = _} |
32 | 32 |
33 functor Make(M : sig | 33 functor Make(M : sig |
34 con cols :: {(Type * Type)} | 34 con cols :: {(Type * Type)} |