diff options
author | Eduardo Julian | 2019-07-24 21:18:30 -0400 |
---|---|---|
committer | Eduardo Julian | 2019-07-24 21:18:30 -0400 |
commit | 68b37de7281d31470263d0e06bc72b1c5b6c2e32 (patch) | |
tree | 0b4d89fbc5fa8ab8a41190bba78425a26e5f21eb /stdlib/source/test/lux/macro/poly/equivalence.lux | |
parent | e87fba1b7204ee611dcb5528b8a8a3716588c976 (diff) |
Got rid of the "Number" abstraction.
Diffstat (limited to 'stdlib/source/test/lux/macro/poly/equivalence.lux')
-rw-r--r-- | stdlib/source/test/lux/macro/poly/equivalence.lux | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/stdlib/source/test/lux/macro/poly/equivalence.lux b/stdlib/source/test/lux/macro/poly/equivalence.lux index ef46b9063..c6dcd4687 100644 --- a/stdlib/source/test/lux/macro/poly/equivalence.lux +++ b/stdlib/source/test/lux/macro/poly/equivalence.lux @@ -1,16 +1,17 @@ (.module: [lux #* ["%" data/text/format (#+ format)] - ["r" math/random (#+ Random)] ["_" test (#+ Test)] - [abstract/monad (#+ do)] + [math + ["." random (#+ Random)]] [abstract + [monad (#+ do)] [equivalence (#+ Equivalence)]] [data ["." bit] ["." maybe] [number - ["." int ("#@." number)]] + ["." int]] ["." text] [collection ["." list]]] @@ -40,25 +41,25 @@ #recursive Recursive}) (def: gen-recursive - (r.Random Recursive) - (r.rec (function (_ gen-recursive) - (r.or r.frac - (r.and r.frac gen-recursive))))) + (Random Recursive) + (random.rec (function (_ gen-recursive) + (random.or random.frac + (random.and random.frac gen-recursive))))) (def: gen-record - (r.Random Record) - (do r.monad - [size (:: @ map (n/% 2) r.nat) - #let [gen-int (|> r.int (:: @ map (|>> int@abs (i/% +1,000,000))))]] - ($_ r.and - r.bit + (Random Record) + (do random.monad + [size (:: @ map (n/% 2) random.nat) + #let [gen-int (|> random.int (:: @ map (|>> int.abs (i/% +1,000,000))))]] + ($_ random.and + random.bit gen-int - r.frac - (r.unicode size) - (r.maybe gen-int) - (r.list size gen-int) - ($_ r.or r.bit gen-int r.frac) - ($_ r.and gen-int r.frac (r.unicode size)) + random.frac + (random.unicode size) + (random.maybe gen-int) + (random.list size gen-int) + ($_ random.or random.bit gen-int random.frac) + ($_ random.and gen-int random.frac (random.unicode size)) gen-recursive))) (derived: equivalence (/.equivalence Record)) @@ -66,7 +67,7 @@ (def: #export test Test (<| (_.context (%.name (name-of /._))) - (do r.monad + (do random.monad [sample gen-record #let [(^open "/@.") ..equivalence]] (_.test "Every instance equals itself." |