Mercurial > urweb
comparison demo/treeFun.ur @ 471:20fab0e96217
Tree demo working (and other assorted regressions fixed)
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 06 Nov 2008 19:43:48 -0500 |
parents | 7cb418e9714f |
children | 1fb318c17546 |
comparison
equal
deleted
inserted
replaced
470:7cb418e9714f | 471:20fab0e96217 |
---|---|
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 {[eqNullable' (SQL 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 |