aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/macro/poly.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/macro/poly.lux26
1 files changed, 13 insertions, 13 deletions
diff --git a/stdlib/source/lux/macro/poly.lux b/stdlib/source/lux/macro/poly.lux
index 914575cc0..bb5c068f7 100644
--- a/stdlib/source/lux/macro/poly.lux
+++ b/stdlib/source/lux/macro/poly.lux
@@ -87,7 +87,7 @@
(Matcher (List Type))
(lambda [:type:]
(let [members (<flattener> (type;un-name :type:))]
- (if (>+ +1 (list;size members))
+ (if (n.> +1 (list;size members))
(:: compiler;Monad<Lux> wrap members)
(compiler;fail (format "Not a " ($AST$ <tag>) " type: " (type;type-to-text :type:)))))))]
@@ -109,7 +109,7 @@
(Matcher [(List Type) Type])
(lambda [:type:]
(let [[ins out] (type;flatten-function (type;un-name :type:))]
- (if (>+ +0 (list;size ins))
+ (if (n.> +0 (list;size ins))
(:: compiler;Monad<Lux> wrap [ins out])
(compiler;fail (format "Not a LambdaT type: " (type;type-to-text :type:)))))))
@@ -146,12 +146,12 @@
(lambda [:type:]
(do compiler;Monad<Lux>
[[tags :type:] (tagged :type:)
- _ (compiler;assert (>+ +0 (list;size tags)) "Records and variants must have tags.")
+ _ (compiler;assert (n.> +0 (list;size tags)) "Records and variants must have tags.")
[vars :type:] (polymorphic :type:)
members (<sub-comb> :type:)
#let [num-tags (list;size tags)
- [init-tags last-tag] (list;split (dec+ num-tags) tags)
- [init-types last-types] (list;split (dec+ num-tags) members)]]
+ [init-tags last-tag] (list;split (n.dec num-tags) tags)
+ [init-types last-types] (list;split (n.dec num-tags) members)]]
(wrap [vars (list;concat (;list (list;zip2 init-tags init-types)
(;list [(default (undefined)
(list;head last-tag))
@@ -214,10 +214,10 @@
(def: (adjusted-idx env idx)
(-> Env Nat Nat)
- (let [env-level (/+ +2 (dict;size env))
- bound-level (/+ +2 idx)
- bound-idx (%+ +2 idx)]
- (|> env-level dec+ (-+ bound-level) (*+ +2) (++ bound-idx))))
+ (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))))
(def: #export (bound env)
(-> Env (Matcher AST))
@@ -239,7 +239,7 @@
(lambda [:type:]
(case :type:
(^=> (#;BoundT idx)
- (=+ var-id (adjusted-idx env idx)))
+ (n.= var-id (adjusted-idx env idx)))
(:: compiler;Monad<Lux> wrap [])
_
@@ -259,8 +259,8 @@
(^=> (#;Cons (#;BoundT idx) :parts:')
{(adjusted-idx env idx)
idx'}
- (=+ base idx'))
- (recur (inc+ base) :parts:')
+ (n.= base idx'))
+ (recur (n.inc base) :parts:')
_
(compiler;fail (format "Type is not a recursive instance: " (type;type-to-text :type:)))))
@@ -277,7 +277,7 @@
(let [current-size (dict;size env)]
(|> env
(dict;put current-size type-func)
- (dict;put (inc+ current-size) tvar)
+ (dict;put (n.inc current-size) tvar)
(extend-env (` (#;AppT (~ type-func) (~ tvar))) type-vars')
))))