aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/poly
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/poly')
-rw-r--r--stdlib/source/poly/lux/abstract/equivalence.lux6
-rw-r--r--stdlib/source/poly/lux/abstract/functor.lux12
-rw-r--r--stdlib/source/poly/lux/data/format/json.lux12
3 files changed, 15 insertions, 15 deletions
diff --git a/stdlib/source/poly/lux/abstract/equivalence.lux b/stdlib/source/poly/lux/abstract/equivalence.lux
index b311d97ec..bcb2574bc 100644
--- a/stdlib/source/poly/lux/abstract/equivalence.lux
+++ b/stdlib/source/poly/lux/abstract/equivalence.lux
@@ -108,7 +108,7 @@
... Variants
(do !
[members (<type>.variant (<>.many equivalence))
- .let [last (dec (list.size members))
+ .let [last (-- (list.size members))
g!_ (code.local_identifier "_____________")
g!left (code.local_identifier "_____________left")
g!right (code.local_identifier "_____________right")]]
@@ -117,8 +117,8 @@
(case [(~ g!left) (~ g!right)]
(~+ (list\join (list\map (function (_ [tag g!eq])
(if (nat.= last tag)
- (list (` [((~ (code.nat (dec tag))) #1 (~ g!left))
- ((~ (code.nat (dec tag))) #1 (~ g!right))])
+ (list (` [((~ (code.nat (-- tag))) #1 (~ g!left))
+ ((~ (code.nat (-- tag))) #1 (~ g!right))])
(` ((~ g!eq) (~ g!left) (~ g!right))))
(list (` [((~ (code.nat tag)) #0 (~ g!left))
((~ (code.nat tag)) #0 (~ g!right))])
diff --git a/stdlib/source/poly/lux/abstract/functor.lux b/stdlib/source/poly/lux/abstract/functor.lux
index 57f047798..d68d55af8 100644
--- a/stdlib/source/poly/lux/abstract/functor.lux
+++ b/stdlib/source/poly/lux/abstract/functor.lux
@@ -38,7 +38,7 @@
(function (_ unwrappedT)
(if (n.= 1 num_vars)
(` ((~! /.Functor) (~ (poly.code *env* unwrappedT))))
- (let [paramsC (|> num_vars dec list.indices (list\map (|>> %.nat code.local_identifier)))]
+ (let [paramsC (|> num_vars -- list.indices (list\map (|>> %.nat code.local_identifier)))]
(` (All [(~+ paramsC)]
((~! /.Functor) ((~ (poly.code *env* unwrappedT)) (~+ paramsC)))))))))
Arg<?> (: (-> Code (<type>.Parser Code))
@@ -46,19 +46,19 @@
($_ p.either
... Type-var
(do p.monad
- [.let [varI (|> num_vars (n.* 2) dec)]
+ [.let [varI (|> num_vars (n.* 2) --)]
_ (<type>.parameter! varI)]
(in (` ((~ funcC) (~ valueC)))))
... Variants
(do !
[_ (in [])
membersC (<type>.variant (p.many (Arg<?> valueC)))
- .let [last (dec (list.size membersC))]]
+ .let [last (-- (list.size membersC))]]
(in (` (case (~ valueC)
(~+ (list\join (list\map (function (_ [tag memberC])
(if (n.= last tag)
- (list (` ((~ (code.nat (dec tag))) #1 (~ valueC)))
- (` ((~ (code.nat (dec tag))) #1 (~ memberC))))
+ (list (` ((~ (code.nat (-- tag))) #1 (~ valueC)))
+ (` ((~ (code.nat (-- tag))) #1 (~ memberC))))
(list (` ((~ (code.nat tag)) #0 (~ valueC)))
(` ((~ (code.nat tag)) #0 (~ memberC))))))
(list.enumeration membersC))))))))
@@ -72,7 +72,7 @@
(do !
[_ (in [])
memberC (Arg<?> slotC)]
- (recur (inc idx)
+ (recur (++ idx)
(list\compose pairsCC (list [slotC memberC])))))
(in pairsCC)))))]
(in (` (case (~ valueC)
diff --git a/stdlib/source/poly/lux/data/format/json.lux b/stdlib/source/poly/lux/data/format/json.lux
index 42f0ed7d8..1496026a7 100644
--- a/stdlib/source/poly/lux/data/format/json.lux
+++ b/stdlib/source/poly/lux/data/format/json.lux
@@ -51,7 +51,7 @@
(function (_ input)
(non_rec (rec_encode non_rec) input)))
-(def: low_mask Nat (|> 1 (i64.left_shifted 32) dec))
+(def: low_mask Nat (|> 1 (i64.left_shifted 32) --))
(def: high_mask Nat (|> low_mask (i64.left_shifted 32)))
(implementation: nat_codec
@@ -166,14 +166,14 @@
[.let [g!_ (code.local_identifier "_______")
g!input (code.local_identifier "_______input")]
members (<type>.variant (<>.many encode))
- .let [last (dec (list.size members))]]
+ .let [last (-- (list.size members))]]
(in (` (: (~ (@JSON\encode inputT))
(function ((~ g!_) (~ g!input))
(case (~ g!input)
(~+ (list\join (list\map (function (_ [tag g!encode])
(if (n.= last tag)
- (.list (` ((~ (code.nat (dec tag))) #1 (~ g!input)))
- (` ((~! /.json) [(~ (code.frac (..tag (dec tag))))
+ (.list (` ((~ (code.nat (-- tag))) #1 (~ g!input)))
+ (` ((~! /.json) [(~ (code.frac (..tag (-- tag))))
#1
((~ g!encode) (~ g!input))])))
(.list (` ((~ (code.nat tag)) #0 (~ g!input)))
@@ -278,14 +278,14 @@
((~! </>.array) ((~! <>.some) (~ subC)))))))
(do !
[members (<type>.variant (<>.many decode))
- .let [last (dec (list.size members))]]
+ .let [last (-- (list.size members))]]
(in (` (: (~ (@JSON\decode inputT))
($_ ((~! <>.or))
(~+ (list\map (function (_ [tag memberC])
(if (n.= last tag)
(` (|> (~ memberC)
((~! <>.after) ((~! </>.boolean!) (~ (code.bit #1))))
- ((~! <>.after) ((~! </>.number!) (~ (code.frac (..tag (dec tag))))))
+ ((~! <>.after) ((~! </>.number!) (~ (code.frac (..tag (-- tag))))))
((~! </>.array))))
(` (|> (~ memberC)
((~! <>.after) ((~! </>.boolean!) (~ (code.bit #0))))