25 lines
282 B
Plaintext
25 lines
282 B
Plaintext
:: depth first library
|
|
::
|
|
|%
|
|
++ traverse
|
|
|= t=(tree @)
|
|
^- (list @)
|
|
?~ t
|
|
~
|
|
%+ weld
|
|
(traverse l.t)
|
|
%+ weld
|
|
(traverse r.t)
|
|
[n.t ~]
|
|
++ search
|
|
|= [t=(tree @) x=@]
|
|
^- ?
|
|
?~ t
|
|
%.n
|
|
?| (search l.t x)
|
|
(search r.t x)
|
|
=(n.t x)
|
|
==
|
|
--
|
|
|