aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/data
diff options
context:
space:
mode:
authorEduardo Julian2020-10-31 20:26:37 -0400
committerEduardo Julian2020-10-31 20:26:37 -0400
commit69272f598d831e89da83bdc8c9290d5607dfb14d (patch)
tree4915f241708344209d4c35ccdc8b8e57bab68e4c /stdlib/source/test/lux/data
parenteea741e9b4a47ae09832311d6d61f0bd6024f673 (diff)
Re-named the directory for my bookmarks to better reflect what they are.
Diffstat (limited to 'stdlib/source/test/lux/data')
-rw-r--r--stdlib/source/test/lux/data/binary.lux6
-rw-r--r--stdlib/source/test/lux/data/collection/array.lux14
-rw-r--r--stdlib/source/test/lux/data/collection/bits.lux14
-rw-r--r--stdlib/source/test/lux/data/collection/dictionary/ordered.lux4
-rw-r--r--stdlib/source/test/lux/data/collection/list.lux26
-rw-r--r--stdlib/source/test/lux/data/collection/queue.lux4
-rw-r--r--stdlib/source/test/lux/data/collection/queue/priority.lux10
-rw-r--r--stdlib/source/test/lux/data/collection/row.lux24
-rw-r--r--stdlib/source/test/lux/data/collection/sequence.lux8
-rw-r--r--stdlib/source/test/lux/data/collection/set/ordered.lux6
-rw-r--r--stdlib/source/test/lux/data/collection/stack.lux85
-rw-r--r--stdlib/source/test/lux/data/collection/tree.lux6
-rw-r--r--stdlib/source/test/lux/data/collection/tree/zipper.lux8
-rw-r--r--stdlib/source/test/lux/data/color.lux10
-rw-r--r--stdlib/source/test/lux/data/number/complex.lux12
-rw-r--r--stdlib/source/test/lux/data/number/i16.lux4
-rw-r--r--stdlib/source/test/lux/data/number/i32.lux4
-rw-r--r--stdlib/source/test/lux/data/number/i64.lux4
-rw-r--r--stdlib/source/test/lux/data/number/i8.lux4
19 files changed, 127 insertions, 126 deletions
diff --git a/stdlib/source/test/lux/data/binary.lux b/stdlib/source/test/lux/data/binary.lux
index c011df720..d3bd06b58 100644
--- a/stdlib/source/test/lux/data/binary.lux
+++ b/stdlib/source/test/lux/data/binary.lux
@@ -77,12 +77,12 @@
(def: #export test
Test
(<| (_.covering /._)
- (do {@ random.monad}
- [#let [gen-size (|> random.nat (:: @ map (|>> (n.% 100) (n.max 8))))]
+ (do {! random.monad}
+ [#let [gen-size (|> random.nat (:: ! map (|>> (n.% 100) (n.max 8))))]
size gen-size
sample (..random size)
value random.nat
- #let [gen-idx (|> random.nat (:: @ map (n.% size)))]
+ #let [gen-idx (|> random.nat (:: ! map (n.% size)))]
[from to] (random.and gen-idx gen-idx)
#let [[from to] [(n.min from to) (n.max from to)]]]
(_.with-cover [/.Binary]
diff --git a/stdlib/source/test/lux/data/collection/array.lux b/stdlib/source/test/lux/data/collection/array.lux
index 4cd81db10..e09e502bc 100644
--- a/stdlib/source/test/lux/data/collection/array.lux
+++ b/stdlib/source/test/lux/data/collection/array.lux
@@ -35,7 +35,7 @@
Test
(<| (_.covering /._)
(_.with-cover [/.Array])
- (do {@ random.monad}
+ (do {! random.monad}
[size ..bounded-size
base random.nat
shift random.nat
@@ -109,8 +109,8 @@
_
false)))
- (do @
- [occupancy (:: @ map (n.% (inc size)) random.nat)]
+ (do !
+ [occupancy (:: ! map (n.% (inc size)) random.nat)]
(_.cover [/.occupancy /.vacancy]
(let [the-array (loop [output (: (Array Nat)
(/.new size))
@@ -122,15 +122,15 @@
(and (n.= occupancy (/.occupancy the-array))
(n.= size (n.+ (/.occupancy the-array)
(/.vacancy the-array)))))))
- (do @
+ (do !
[the-list (random.list size random.nat)]
(_.cover [/.from-list /.to-list]
(and (|> the-list /.from-list /.to-list
(:: (list.equivalence n.equivalence) = the-list))
(|> the-array /.to-list /.from-list
(:: (/.equivalence n.equivalence) = the-array)))))
- (do @
- [amount (:: @ map (n.% (inc size)) random.nat)]
+ (do !
+ [amount (:: ! map (n.% (inc size)) random.nat)]
(_.cover [/.copy!]
(let [copy (: (Array Nat)
(/.new size))]
@@ -150,7 +150,7 @@
(and (n.= (list.size evens) (/.occupancy the-array))
(n.= (list.size odds) (/.vacancy the-array))
(|> the-array /.to-list (:: (list.equivalence n.equivalence) = evens))))))
- (do @
+ (do !
[#let [the-array (/.clone the-array)
members (|> the-array /.to-list (set.from-list n.hash))]
default (random.filter (function (_ value)
diff --git a/stdlib/source/test/lux/data/collection/bits.lux b/stdlib/source/test/lux/data/collection/bits.lux
index cadd2d26d..a31fec37c 100644
--- a/stdlib/source/test/lux/data/collection/bits.lux
+++ b/stdlib/source/test/lux/data/collection/bits.lux
@@ -22,12 +22,12 @@
(def: #export random
(Random Bits)
- (do {@ random.monad}
- [size (:: @ map (n.% 1,000) random.nat)]
+ (do {! random.monad}
+ [size (:: ! map (n.% 1,000) random.nat)]
(case size
0 (wrap /.empty)
- _ (do {@ random.monad}
- [idx (|> random.nat (:: @ map (n.% size)))]
+ _ (do {! random.monad}
+ [idx (|> random.nat (:: ! map (n.% size)))]
(wrap (/.set idx /.empty))))))
(def: #export test
@@ -47,9 +47,9 @@
(_.cover [/.empty]
(/.empty? /.empty))
- (do {@ random.monad}
- [size (:: @ map (|>> (n.% 1,000) inc) random.nat)
- idx (:: @ map (n.% size) random.nat)
+ (do {! random.monad}
+ [size (:: ! map (|>> (n.% 1,000) inc) random.nat)
+ idx (:: ! map (n.% size) random.nat)
sample ..random]
($_ _.and
(_.cover [/.get /.set]
diff --git a/stdlib/source/test/lux/data/collection/dictionary/ordered.lux b/stdlib/source/test/lux/data/collection/dictionary/ordered.lux
index f45f1d0d4..e396dd81a 100644
--- a/stdlib/source/test/lux/data/collection/dictionary/ordered.lux
+++ b/stdlib/source/test/lux/data/collection/dictionary/ordered.lux
@@ -40,8 +40,8 @@
(def: #export test
Test
(<| (_.context (%.name (name-of /.Dictionary)))
- (do {@ r.monad}
- [size (|> r.nat (:: @ map (n.% 100)))
+ (do {! r.monad}
+ [size (|> r.nat (:: ! map (n.% 100)))
keys (r.set n.hash size r.nat)
values (r.set n.hash size r.nat)
extra-key (|> r.nat (r.filter (|>> (set.member? keys) not)))
diff --git a/stdlib/source/test/lux/data/collection/list.lux b/stdlib/source/test/lux/data/collection/list.lux
index 92cec10e8..a81de6c24 100644
--- a/stdlib/source/test/lux/data/collection/list.lux
+++ b/stdlib/source/test/lux/data/collection/list.lux
@@ -39,11 +39,11 @@
(def: random
(Random (List Nat))
- (do {@ random.monad}
+ (do {! random.monad}
[size ..bounded-size]
(|> random.nat
(random.set n.hash size)
- (:: @ map set.to-list))))
+ (:: ! map set.to-list))))
(def: signatures
Test
@@ -61,7 +61,7 @@
(_.with-cover [/.monad]
($monad.spec /@wrap /.equivalence /.monad))
- (do {@ random.monad}
+ (do {! random.monad}
[parameter random.nat
subject random.nat]
(let [lift (/.lift io.monad)
@@ -81,10 +81,10 @@
(def: whole
Test
- (do {@ random.monad}
+ (do {! random.monad}
[size ..bounded-size
#let [(^open "/@.") (/.equivalence n.equivalence)]
- sample (:: @ map set.to-list (random.set n.hash size random.nat))]
+ sample (:: ! map set.to-list (random.set n.hash size random.nat))]
($_ _.and
(_.cover [/.size]
(n.= size (/.size sample)))
@@ -127,7 +127,7 @@
Test
(let [(^open "/@.") (/.equivalence n.equivalence)
(^open "/@.") /.functor]
- (do {@ random.monad}
+ (do {! random.monad}
[sample ..random
#let [size (/.size sample)]]
($_ _.and
@@ -176,11 +176,11 @@
Test
(let [(^open "/@.") (/.equivalence n.equivalence)
(^open "/@.") /.monoid]
- (do {@ random.monad}
+ (do {! random.monad}
[sample ..random
#let [size (/.size sample)]
- idx (:: @ map (n.% size) random.nat)
- chunk-size (:: @ map (|>> (n.% size) inc) random.nat)]
+ idx (:: ! map (n.% size) random.nat)
+ chunk-size (:: ! map (|>> (n.% size) inc) random.nat)]
($_ _.and
(_.cover [/.filter]
(let [positives (/.filter n.even? sample)
@@ -223,7 +223,7 @@
(def: member
Test
(let [(^open "/@.") (/.equivalence n.equivalence)]
- (do {@ random.monad}
+ (do {! random.monad}
[sample ..random]
(`` ($_ _.and
(_.cover [/.member?]
@@ -270,7 +270,7 @@
+/3 (: (-> Nat Nat Nat Nat)
(function (_ left mid right)
($_ n.+ left mid right)))]
- (do {@ random.monad}
+ (do {! random.monad}
[sample/0 ..random
sample/1 ..random
sample/2 ..random]
@@ -352,7 +352,7 @@
(if (n.even? value)
(#.Some (:: n.decimal encode value))
#.None)))]
- (do {@ random.monad}
+ (do {! random.monad}
[sample ..random]
($_ _.and
(_.cover [/.one]
@@ -390,7 +390,7 @@
(_.with-cover [.List])
(let [(^open "/@.") (/.equivalence n.equivalence)
(^open "/@.") /.functor]
- (do {@ random.monad}
+ (do {! random.monad}
[sample ..random
separator random.nat]
($_ _.and
diff --git a/stdlib/source/test/lux/data/collection/queue.lux b/stdlib/source/test/lux/data/collection/queue.lux
index f646fd82a..9cc7c4500 100644
--- a/stdlib/source/test/lux/data/collection/queue.lux
+++ b/stdlib/source/test/lux/data/collection/queue.lux
@@ -28,8 +28,8 @@
Test
(<| (_.covering /._)
(_.with-cover [/.Queue])
- (do {@ random.monad}
- [size (:: @ map (n.% 100) random.nat)
+ (do {! random.monad}
+ [size (:: ! map (n.% 100) random.nat)
members (random.set n.hash size random.nat)
non-member (random.filter (|>> (set.member? members) not)
random.nat)
diff --git a/stdlib/source/test/lux/data/collection/queue/priority.lux b/stdlib/source/test/lux/data/collection/queue/priority.lux
index 7f9b42046..555214148 100644
--- a/stdlib/source/test/lux/data/collection/queue/priority.lux
+++ b/stdlib/source/test/lux/data/collection/queue/priority.lux
@@ -15,10 +15,10 @@
(def: #export (queue size)
(-> Nat (Random (Queue Nat)))
- (do {@ r.monad}
+ (do {! r.monad}
[inputs (r.list size r.nat)]
- (monad.fold @ (function (_ head tail)
- (do @
+ (monad.fold ! (function (_ head tail)
+ (do !
[priority r.nat]
(wrap (/.push priority head tail))))
/.empty
@@ -27,8 +27,8 @@
(def: #export test
Test
(<| (_.context (%.name (name-of /.Queue)))
- (do {@ r.monad}
- [size (|> r.nat (:: @ map (n.% 100)))
+ (do {! r.monad}
+ [size (|> r.nat (:: ! map (n.% 100)))
sample (..queue size)
non-member-priority r.nat
non-member (|> r.nat (r.filter (|>> (/.member? n.equivalence sample) not)))]
diff --git a/stdlib/source/test/lux/data/collection/row.lux b/stdlib/source/test/lux/data/collection/row.lux
index e096c9085..716b03168 100644
--- a/stdlib/source/test/lux/data/collection/row.lux
+++ b/stdlib/source/test/lux/data/collection/row.lux
@@ -28,8 +28,8 @@
(def: signatures
Test
- (do {@ random.monad}
- [size (:: @ map (n.% 100) random.nat)]
+ (do {! random.monad}
+ [size (:: ! map (n.% 100) random.nat)]
($_ _.and
(_.with-cover [/.equivalence]
($equivalence.spec (/.equivalence n.equivalence) (random.row size random.nat)))
@@ -47,8 +47,8 @@
(def: whole
Test
- (do {@ random.monad}
- [size (:: @ map (n.% 100) random.nat)
+ (do {! random.monad}
+ [size (:: ! map (n.% 100) random.nat)
sample (random.set n.hash size random.nat)
#let [sample (|> sample set.to-list /.from-list)]
#let [(^open "/@.") (/.equivalence n.equivalence)]]
@@ -80,11 +80,11 @@
(def: index-based
Test
- (do {@ random.monad}
- [size (:: @ map (|>> (n.% 100) inc) random.nat)]
+ (do {! random.monad}
+ [size (:: ! map (|>> (n.% 100) inc) random.nat)]
($_ _.and
- (do @
- [good-index (|> random.nat (:: @ map (n.% size)))
+ (do !
+ [good-index (|> random.nat (:: ! map (n.% size)))
#let [bad-index (n.+ size good-index)]
sample (random.set n.hash size random.nat)
non-member (random.filter (|>> (set.member? sample) not)
@@ -133,21 +133,21 @@
Test
(<| (_.covering /._)
(_.with-cover [/.Row])
- (do {@ random.monad}
- [size (:: @ map (|>> (n.% 100) inc) random.nat)]
+ (do {! random.monad}
+ [size (:: ! map (|>> (n.% 100) inc) random.nat)]
($_ _.and
..signatures
..whole
..index-based
- (do @
+ (do !
[sample (random.set n.hash size random.nat)
non-member (random.filter (|>> (set.member? sample) not)
random.nat)
#let [sample (|> sample set.to-list /.from-list)]
#let [(^open "/@.") (/.equivalence n.equivalence)]]
($_ _.and
- (do @
+ (do !
[value/0 random.nat
value/1 random.nat
value/2 random.nat]
diff --git a/stdlib/source/test/lux/data/collection/sequence.lux b/stdlib/source/test/lux/data/collection/sequence.lux
index 3cd41c4b2..ad1dd0448 100644
--- a/stdlib/source/test/lux/data/collection/sequence.lux
+++ b/stdlib/source/test/lux/data/collection/sequence.lux
@@ -36,11 +36,11 @@
(<| (_.covering /._)
(_.with-cover [/.Sequence])
(let [(^open "list@.") (list.equivalence n.equivalence)])
- (do {@ random.monad}
+ (do {! random.monad}
[repeated random.nat
- index (:: @ map (n.% 100) random.nat)
- size (:: @ map (|>> (n.% 10) inc) random.nat)
- offset (:: @ map (n.% 100) random.nat)
+ index (:: ! map (n.% 100) random.nat)
+ size (:: ! map (|>> (n.% 10) inc) random.nat)
+ offset (:: ! map (n.% 100) random.nat)
cycle-start random.nat
cycle-next (random.list size random.nat)]
($_ _.and
diff --git a/stdlib/source/test/lux/data/collection/set/ordered.lux b/stdlib/source/test/lux/data/collection/set/ordered.lux
index 867fa4308..335eb0226 100644
--- a/stdlib/source/test/lux/data/collection/set/ordered.lux
+++ b/stdlib/source/test/lux/data/collection/set/ordered.lux
@@ -46,11 +46,11 @@
($_ _.and
($equivalence.spec /.equivalence (..set n.order r.nat size))
))
- (do {@ r.monad}
+ (do {! r.monad}
[sizeL gen-nat
sizeR gen-nat
- listL (|> (r.set n.hash sizeL gen-nat) (:: @ map //.to-list))
- listR (|> (r.set n.hash sizeR gen-nat) (:: @ map //.to-list))
+ listL (|> (r.set n.hash sizeL gen-nat) (:: ! map //.to-list))
+ listR (|> (r.set n.hash sizeR gen-nat) (:: ! map //.to-list))
#let [(^open "/@.") /.equivalence
setL (/.from-list n.order listL)
setR (/.from-list n.order listR)
diff --git a/stdlib/source/test/lux/data/collection/stack.lux b/stdlib/source/test/lux/data/collection/stack.lux
index a8a2ceeeb..80b7fce63 100644
--- a/stdlib/source/test/lux/data/collection/stack.lux
+++ b/stdlib/source/test/lux/data/collection/stack.lux
@@ -1,6 +1,5 @@
(.module:
[lux #*
- ["%" data/text/format (#+ format)]
["_" test (#+ Test)]
[abstract
[monad (#+ do)]
@@ -10,10 +9,11 @@
["$." functor (#+ Injection)]]}]
[data
["." maybe]
+ ["." bit ("#@." equivalence)]
[number
["n" nat]]]
[math
- ["r" random]]]
+ ["." random]]]
{1
["." /]})
@@ -21,48 +21,49 @@
(Injection /.Stack)
(/.push value /.empty))
-(def: gen-nat
- (r.Random Nat)
- (|> r.nat
- (:: r.monad map (n.% 100))))
-
(def: #export test
Test
- (<| (_.context (%.name (name-of /._)))
- (do r.monad
- [size gen-nat
- sample (r.stack size gen-nat)
- new-top gen-nat]
+ (<| (_.covering /._)
+ (_.with-cover [/.Stack])
+ (do random.monad
+ [size (:: random.monad map (n.% 100) random.nat)
+ sample (random.stack size random.nat)
+ expected-top random.nat]
($_ _.and
- ($equivalence.spec (/.equivalence n.equivalence) (r.stack size r.nat))
- ($functor.spec ..injection /.equivalence /.functor)
+ (_.with-cover [/.equivalence]
+ ($equivalence.spec (/.equivalence n.equivalence) (random.stack size random.nat)))
+ (_.with-cover [/.functor]
+ ($functor.spec ..injection /.equivalence /.functor))
- (_.test (%.name (name-of /.size))
- (n.= size (/.size sample)))
- (_.test (%.name (name-of /.peek))
- (case (/.peek sample)
- #.None (/.empty? sample)
- (#.Some _) (not (/.empty? sample))))
- (_.test (%.name (name-of /.pop))
- (case (/.size sample)
- 0 (case (/.pop sample)
- #.None
- (/.empty? sample)
-
- (#.Some _)
- false)
- expected (case (/.pop sample)
- (#.Some sample')
- (and (n.= (dec expected) (/.size sample'))
- (not (/.empty? sample)))
-
- #.None
- false)))
- (_.test (%.name (name-of /.push))
- (and (is? sample
- (|> sample (/.push new-top) /.pop maybe.assume))
- (n.= (inc (/.size sample))
- (/.size (/.push new-top sample)))
- (|> (/.push new-top sample) /.peek maybe.assume
- (is? new-top))))
+ (_.cover [/.size]
+ (n.= size (/.size sample)))
+ (_.cover [/.empty?]
+ (bit@= (n.= 0 (/.size sample))
+ (/.empty? sample)))
+ (_.cover [/.empty]
+ (/.empty? /.empty))
+ (_.cover [/.peek]
+ (case (/.peek sample)
+ #.None
+ (/.empty? sample)
+
+ (#.Some _)
+ (not (/.empty? sample))))
+ (_.cover [/.pop]
+ (case (/.pop sample)
+ #.None
+ (/.empty? sample)
+
+ (#.Some [top remaining])
+ (:: (/.equivalence n.equivalence) =
+ sample
+ (/.push top remaining))))
+ (_.cover [/.push]
+ (case (/.pop (/.push expected-top sample))
+ (#.Some [actual-top actual-sample])
+ (and (is? expected-top actual-top)
+ (is? sample actual-sample))
+
+ #.None
+ false))
))))
diff --git a/stdlib/source/test/lux/data/collection/tree.lux b/stdlib/source/test/lux/data/collection/tree.lux
index 37dd216b2..8ba66ef02 100644
--- a/stdlib/source/test/lux/data/collection/tree.lux
+++ b/stdlib/source/test/lux/data/collection/tree.lux
@@ -48,14 +48,14 @@
(def: #export test
Test
(<| (_.context (%.name (name-of /.Tree)))
- (do {@ r.monad}
- [size (:: @ map (|>> (n.% 100) (n.+ 1)) r.nat)]
+ (do {! r.monad}
+ [size (:: ! map (|>> (n.% 100) (n.+ 1)) r.nat)]
($_ _.and
($equivalence.spec (/.equivalence n.equivalence) (..tree size r.nat))
($fold.spec /.leaf /.equivalence /.fold)
($functor.spec /.leaf /.equivalence /.functor)
- (do @
+ (do !
[sample (..tree size r.nat)]
(_.test "Can flatten a tree to get all the nodes as a flat tree."
(n.= size
diff --git a/stdlib/source/test/lux/data/collection/tree/zipper.lux b/stdlib/source/test/lux/data/collection/tree/zipper.lux
index 74fda6cc1..7354eafed 100644
--- a/stdlib/source/test/lux/data/collection/tree/zipper.lux
+++ b/stdlib/source/test/lux/data/collection/tree/zipper.lux
@@ -23,8 +23,8 @@
(def: #export test
Test
(<| (_.context (%.name (name-of /.Zipper)))
- (do {@ r.monad}
- [size (:: @ map (|>> (n.% 90) (n.+ 10)) r.nat)
+ (do {! r.monad}
+ [size (:: ! map (|>> (n.% 90) (n.+ 10)) r.nat)
sample (//.tree size r.nat)
mid-val r.nat
new-val r.nat
@@ -48,7 +48,7 @@
(|> child /.start (is? zipper) not)))
(and (/.leaf? zipper)
(|> zipper (/.prepend-child new-val) /.branch?)))))
- (do @
+ (do !
[branch-value r.nat
#let [zipper (|> (/.zip (tree.branch branch-value (list (tree.leaf mid-val))))
(/.prepend-child pre-val)
@@ -60,7 +60,7 @@
(|> zipper /.down /.right /.value (is? mid-val))
(and (|> zipper /.down /.right /.right /.value (is? post-val))
(|> zipper /.down /.rightmost /.value (is? post-val))))))
- (do @
+ (do !
[branch-value r.nat
#let [zipper (/.zip (tree.branch branch-value (list (tree.leaf mid-val))))]]
(_.test "Can insert children around a node (unless it's start)."
diff --git a/stdlib/source/test/lux/data/color.lux b/stdlib/source/test/lux/data/color.lux
index 388b49d93..ca84d8b07 100644
--- a/stdlib/source/test/lux/data/color.lux
+++ b/stdlib/source/test/lux/data/color.lux
@@ -125,16 +125,16 @@
(def: palette
Test
(_.with-cover [/.Spread /.Palette]
- (do {@ random.monad}
- [eH (:: @ map (|>> f.abs (f.% +0.9) (f.+ +0.05))
+ (do {! random.monad}
+ [eH (:: ! map (|>> f.abs (f.% +0.9) (f.+ +0.05))
random.safe-frac)
#let [eS +0.5]
- variations (:: @ map (|>> (n.% 3) (n.+ 2)) random.nat)
+ variations (:: ! map (|>> (n.% 3) (n.+ 2)) random.nat)
#let [max-spread (f./ (|> variations inc .int int.frac)
+1.0)
min-spread (f./ +2.0 max-spread)
spread-space (f.- min-spread max-spread)]
- spread (:: @ map (|>> f.abs (f.% spread-space) (f.+ min-spread))
+ spread (:: ! map (|>> f.abs (f.% spread-space) (f.+ min-spread))
random.safe-frac)]
(`` ($_ _.and
(~~ (template [<brightness> <palette>]
@@ -175,7 +175,7 @@
Test
(<| (_.covering /._)
(_.with-cover [/.Color])
- (do {@ random.monad}
+ (do {! random.monad}
[expected ..color]
($_ _.and
(_.with-cover [/.equivalence]
diff --git a/stdlib/source/test/lux/data/number/complex.lux b/stdlib/source/test/lux/data/number/complex.lux
index 330361792..091814105 100644
--- a/stdlib/source/test/lux/data/number/complex.lux
+++ b/stdlib/source/test/lux/data/number/complex.lux
@@ -34,8 +34,8 @@
(def: dimension
(Random Frac)
- (do {@ r.monad}
- [factor (|> r.nat (:: @ map (|>> (n.% 1000) (n.max 1))))
+ (do {! r.monad}
+ [factor (|> r.nat (:: ! map (|>> (n.% 1000) (n.max 1))))
measure (|> r.safe-frac (r.filter (f.> +0.0)))]
(wrap (f.* (|> factor .int int.frac)
measure))))
@@ -159,8 +159,8 @@
(def: trigonometry
Test
- (do {@ r.monad}
- [angle (|> ..complex (:: @ map (|>> (update@ #/.real (f.% +1.0))
+ (do {! r.monad}
+ [angle (|> ..complex (:: ! map (|>> (update@ #/.real (f.% +1.0))
(update@ #/.imaginary (f.% +1.0)))))]
($_ _.and
(_.test "Arc-sine is the inverse of sine."
@@ -183,9 +183,9 @@
(def: root
Test
- (do {@ r.monad}
+ (do {! r.monad}
[sample ..complex
- degree (|> r.nat (:: @ map (|>> (n.max 1) (n.% 5))))]
+ degree (|> r.nat (:: ! map (|>> (n.max 1) (n.% 5))))]
(_.test "Can calculate the N roots for any complex number."
(|> sample
(/.roots degree)
diff --git a/stdlib/source/test/lux/data/number/i16.lux b/stdlib/source/test/lux/data/number/i16.lux
index a00a26e9e..edfadf62d 100644
--- a/stdlib/source/test/lux/data/number/i16.lux
+++ b/stdlib/source/test/lux/data/number/i16.lux
@@ -28,8 +28,8 @@
(def: #export test
Test
(<| (_.context (name.module (name-of /._)))
- (do {@ r.monad}
- [expected (:: @ map (|>> (//i64.and ..mask) (: I64)) r.i64)]
+ (do {! r.monad}
+ [expected (:: ! map (|>> (//i64.and ..mask) (: I64)) r.i64)]
($_ _.and
($equivalence.spec /.equivalence ..i16)
diff --git a/stdlib/source/test/lux/data/number/i32.lux b/stdlib/source/test/lux/data/number/i32.lux
index d126e5b03..f5d32ba21 100644
--- a/stdlib/source/test/lux/data/number/i32.lux
+++ b/stdlib/source/test/lux/data/number/i32.lux
@@ -28,8 +28,8 @@
(def: #export test
Test
(<| (_.context (name.module (name-of /._)))
- (do {@ r.monad}
- [expected (:: @ map (|>> (//i64.and ..mask) (: I64)) r.i64)]
+ (do {! r.monad}
+ [expected (:: ! map (|>> (//i64.and ..mask) (: I64)) r.i64)]
($_ _.and
($equivalence.spec /.equivalence ..i32)
diff --git a/stdlib/source/test/lux/data/number/i64.lux b/stdlib/source/test/lux/data/number/i64.lux
index 592b5fe41..6834f6276 100644
--- a/stdlib/source/test/lux/data/number/i64.lux
+++ b/stdlib/source/test/lux/data/number/i64.lux
@@ -22,9 +22,9 @@
(def: #export test
Test
(<| (_.context (name.module (name-of /._)))
- (do {@ r.monad}
+ (do {! r.monad}
[pattern r.nat
- idx (:: @ map (//nat.% /.width) r.nat)]
+ idx (:: ! map (//nat.% /.width) r.nat)]
($_ _.and
($equivalence.spec /.equivalence r.i64)
($monoid.spec //nat.equivalence /.disjunction r.nat)
diff --git a/stdlib/source/test/lux/data/number/i8.lux b/stdlib/source/test/lux/data/number/i8.lux
index aac5f063a..53b196e41 100644
--- a/stdlib/source/test/lux/data/number/i8.lux
+++ b/stdlib/source/test/lux/data/number/i8.lux
@@ -28,8 +28,8 @@
(def: #export test
Test
(<| (_.context (name.module (name-of /._)))
- (do {@ r.monad}
- [expected (:: @ map (|>> (//i64.and ..mask) (: I64)) r.i64)]
+ (do {! r.monad}
+ [expected (:: ! map (|>> (//i64.and ..mask) (: I64)) r.i64)]
($_ _.and
($equivalence.spec /.equivalence ..i8)