summaryrefslogtreecommitdiff
path: root/tests/treeDyn.ur
blob: 1d58cca5b628d5d2cebf4a0e99f117a3509c5b0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
table t : {Id : int, Parent : option int}

fun recurse (root : option int) =
    queryX' (SELECT * FROM t WHERE {eqNullable' (SQL t.Parent) root})
            (fn r =>
                children <- recurse (Some r.T.Id);
                (*s <- source False;*)
                return <xml>
                  <dyn signal={(*v <- signal s;
                               if v then*)
                                   return <xml><b>HI</b>{children}<b>BYE</b></xml>
                               (*else
                                   return <xml/>*)}/>
                </xml>)

fun main () =
    x <- recurse None;
    return <xml><body>{x}</body></xml>