diff options
author | Eduardo Julian | 2017-05-09 19:16:50 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-05-09 19:16:50 -0400 |
commit | 1013353c0d1e7517faa3a9c42751a11075fbc87a (patch) | |
tree | e58df930923e32273e3dd3b5098a436735cbc4b6 /stdlib | |
parent | fb031d2157cfbebe359ab58db02de363b96fe909 (diff) |
- Made a small refactoring to walk around a current optimization error that confounds variables and makes you access the wrong value at run-time.
- TODO: Fix said error.
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))) |