Mercurial > urweb
comparison demo/treeFun.ur @ 470:7cb418e9714f
Tree demo works
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 06 Nov 2008 18:49:38 -0500 |
parents | b393c2fc80f8 |
children | 20fab0e96217 |
comparison
equal
deleted
inserted
replaced
469:b393c2fc80f8 | 470:7cb418e9714f |
---|---|
16 | 16 |
17 fun tree (f : $([id = key, parent = option key] ++ cols) -> xbody) | 17 fun tree (f : $([id = key, parent = option key] ++ cols) -> xbody) |
18 (root : option M.key) = | 18 (root : option M.key) = |
19 let | 19 let |
20 fun recurse (root : option key) = | 20 fun recurse (root : option key) = |
21 queryX' (SELECT * FROM tab WHERE tab.{parent} = {root}) | 21 queryX' (SELECT * FROM tab WHERE {[eqNullable' (SQL tab.{parent}) root]}) |
22 (fn r => | 22 (fn r => |
23 children <- recurse (Some r.Tab.id); | 23 children <- recurse (Some r.Tab.id); |
24 return <xml> | 24 return <xml> |
25 <li> {f r.Tab}</li> | 25 <li> {f r.Tab}</li> |
26 | 26 |