adam@1457: table t : {Id : int, Parent : option int}
adam@1457:
adam@1457: fun recurse (root : option int) =
adam@1457: queryX' (SELECT * FROM t WHERE {eqNullable' (SQL t.Parent) root})
adam@1457: (fn r =>
adam@1457: children <- recurse (Some r.T.Id);
adam@1457: (*s <- source False;*)
adam@1457: return
adam@1457: HI{children}BYE
adam@1457: (*else
adam@1457: return *)}/>
adam@1457: )
adam@1457:
adam@1457: fun main () =
adam@1457: x <- recurse None;
adam@1457: return {x}