diff options
Diffstat (limited to 'stdlib/source/lux/macro/poly.lux')
-rw-r--r-- | stdlib/source/lux/macro/poly.lux | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/stdlib/source/lux/macro/poly.lux b/stdlib/source/lux/macro/poly.lux index 54a856463..4d9d6cf12 100644 --- a/stdlib/source/lux/macro/poly.lux +++ b/stdlib/source/lux/macro/poly.lux @@ -151,19 +151,19 @@ all-varsL (: (List Code) (list))] (if (n/< num-args current-arg) (if (n/= +0 current-arg) - (let [varL (label (n/inc funcI))] - (recur (n/inc current-arg) + (let [varL (label (inc funcI))] + (recur (inc current-arg) (|> env' (dict.put funcI [headT funcL]) - (dict.put (n/inc funcI) [(#.Bound (n/inc funcI)) varL])) + (dict.put (inc funcI) [(#.Bound (inc funcI)) varL])) (#.Cons varL all-varsL))) (let [partialI (|> current-arg (n/* +2) (n/+ funcI)) - partial-varI (n/inc partialI) + partial-varI (inc partialI) partial-varL (label partial-varI) - partialC (` ((~ funcL) (~+ (|> (list.n/range +0 (n/dec num-args)) - (list/map (|>> (n/* +2) n/inc (n/+ funcI) label)) + partialC (` ((~ funcL) (~+ (|> (list.n/range +0 (dec num-args)) + (list/map (|>> (n/* +2) inc (n/+ funcI) label)) list.reverse))))] - (recur (n/inc current-arg) + (recur (inc current-arg) (|> env' (dict.put partialI [.Bottom partialC]) (dict.put partial-varI [(#.Bound partial-varI) partial-varL])) @@ -215,7 +215,7 @@ (let [env-level (n// +2 (dict.size env)) bound-level (n// +2 idx) bound-idx (n/% +2 idx)] - (|> env-level n/dec (n/- bound-level) (n/* +2) (n/+ bound-idx)))) + (|> env-level dec (n/- bound-level) (n/* +2) (n/+ bound-idx)))) (def: #export bound (Poly Code) @@ -402,7 +402,7 @@ (let [idx (adjusted-idx env idx)] (if (n/= +0 idx) (|> (dict.get idx env) maybe.assume product.left (to-code env)) - (` (.$ (~ (code.nat (n/dec idx))))))) + (` (.$ (~ (code.nat (dec idx))))))) (#.Apply (#.Named ["lux" "Bottom"] _) (#.Bound idx)) (let [idx (adjusted-idx env idx)] |