diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/data/coll/tree/finger.lux | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/stdlib/source/lux/data/coll/tree/finger.lux b/stdlib/source/lux/data/coll/tree/finger.lux index e338b551e..ba66abcff 100644 --- a/stdlib/source/lux/data/coll/tree/finger.lux +++ b/stdlib/source/lux/data/coll/tree/finger.lux @@ -1,6 +1,6 @@ (;module: lux - (lux (control monoid) + (lux (control ["m" monoid]) (data text/format))) (type: #export (Node m a) @@ -8,7 +8,7 @@ (#Branch m (Node m a) (Node m a))) (type: #export (Fingers m a) - {#monoid (Monoid m) + {#monoid (m;Monoid m) #tree (Node m a)}) (def: #export (tag fingers) @@ -36,18 +36,17 @@ (def: #export (search pred fingers) (All [m a] (-> (-> m Bool) (Fingers m a) (Maybe a))) - (if (pred (tag fingers)) - (let [(^open "tag/") (get@ #monoid fingers)] - (loop [_tag tag/unit + (let [tag/append (get@ [#monoid #m;append] fingers)] + (if (pred (tag fingers)) + (loop [_tag (get@ [#monoid #m;unit] fingers) _node (get@ #tree fingers)] (case _node (#Leaf _ value) (#;Some value) (#Branch _ left right) - (let [shifted-tag (tag/append _tag - (tag (set@ #tree left fingers)))] + (let [shifted-tag (tag/append _tag (tag (set@ #tree left fingers)))] (if (pred shifted-tag) (recur _tag left) - (recur shifted-tag right)))))) - #;None)) + (recur shifted-tag right))))) + #;None))) |