aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/data/collection/list.lux
diff options
context:
space:
mode:
authorEduardo Julian2019-07-26 21:23:27 -0400
committerEduardo Julian2019-07-26 21:23:27 -0400
commita0889b2ee76c1ae7a9a5bbe2eec9f051b4f341e4 (patch)
tree08df3db7f8fffad6360a476d20db1d40b36c85cb /stdlib/source/lux/data/collection/list.lux
parent78fd01f7e6688448bbd710336d4d7b1c35ae058a (diff)
No more "n/"-prefixed functions.
Diffstat (limited to 'stdlib/source/lux/data/collection/list.lux')
-rw-r--r--stdlib/source/lux/data/collection/list.lux28
1 files changed, 15 insertions, 13 deletions
diff --git a/stdlib/source/lux/data/collection/list.lux b/stdlib/source/lux/data/collection/list.lux
index abf9d3fe8..1e00ee529 100644
--- a/stdlib/source/lux/data/collection/list.lux
+++ b/stdlib/source/lux/data/collection/list.lux
@@ -11,7 +11,9 @@
["." monad (#+ do Monad)]]
[data
["." bit]
- ["." product]]])
+ ["." product]
+ [number
+ ["n" nat]]]])
## (type: (List a)
## #Nil
@@ -73,7 +75,7 @@
[(def: #export (<name> n xs)
(All [a]
(-> Nat (List a) (List a)))
- (if (n/> 0 n)
+ (if (n.> 0 n)
(case xs
#.Nil
#.Nil
@@ -106,7 +108,7 @@
(def: #export (split n xs)
(All [a]
(-> Nat (List a) [(List a) (List a)]))
- (if (n/> 0 n)
+ (if (n.> 0 n)
(case xs
#.Nil
[#.Nil #.Nil]
@@ -150,7 +152,7 @@
{#.doc "A list of the value x, repeated n times."}
(All [a]
(-> Nat a (List a)))
- (if (n/> 0 n)
+ (if (n.> 0 n)
(#.Cons [x (repeat (dec n) x)])
#.Nil))
@@ -234,7 +236,7 @@
(def: #export (size list)
(All [a] (-> (List a) Nat))
- (fold (function (_ _ acc) (n/+ 1 acc)) 0 list))
+ (fold (function (_ _ acc) (n.+ 1 acc)) 0 list))
(template [<name> <init> <op>]
[(def: #export (<name> predicate xs)
@@ -266,7 +268,7 @@
#.None
(#.Cons [x xs'])
- (if (n/= 0 i)
+ (if (n.= 0 i)
(#.Some x)
(nth (dec i) xs'))))
@@ -351,7 +353,7 @@
(list from)))]
[i/range Int "lux i64 <"]
- [n/range Nat n/<]
+ [n/range Nat n.<]
)
(def: #export (empty? xs)
@@ -385,7 +387,7 @@
(def: #export (indices size)
{#.doc "Produces all the valid indices for a given size."}
(All [a] (-> Nat (List Nat)))
- (if (n/= 0 size)
+ (if (n.= 0 size)
(list)
(|> size dec (n/range 0))))
@@ -397,7 +399,7 @@
(-> Nat Text)
(loop [input value
output ""]
- (let [digit (case (n/% 10 input)
+ (let [digit (case (n.% 10 input)
0 "0"
1 "1"
2 "2"
@@ -410,8 +412,8 @@
9 "9"
_ (undefined))
output' ("lux text concat" digit output)
- input' (n// 10 input)]
- (if (n/= 0 input')
+ input' (n./ 10 input)]
+ (if (n.= 0 input')
output'
(recur input' output')))))
@@ -422,7 +424,7 @@
((zip 3) xs ys zs))}
(case tokens
(^ (list [_ (#.Nat num-lists)]))
- (if (n/> 0 num-lists)
+ (if (n.> 0 num-lists)
(let [(^open ".") ..functor
indices (..indices num-lists)
type-vars (: (List Code) (map (|>> nat@encode identifier$) indices))
@@ -466,7 +468,7 @@
((zip-with 2) + xs ys))}
(case tokens
(^ (list [_ (#.Nat num-lists)]))
- (if (n/> 0 num-lists)
+ (if (n.> 0 num-lists)
(let [(^open ".") ..functor
indices (..indices num-lists)
g!return-type (identifier$ "0return-type0")