From 9671d6064dd02dfe6c32492f5b9907b096e5bd89 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 21 Jul 2018 23:57:21 -0400 Subject: Re-named "seq" to "and" and "alt" to "or". --- .../lux/compiler/default/phase/analysis/primitive.lux | 2 +- .../lux/compiler/default/phase/synthesis/primitive.lux | 2 +- stdlib/test/test/lux/compiler/default/syntax.lux | 4 ++-- stdlib/test/test/lux/concurrency/promise.lux | 10 +++++----- .../test/test/lux/data/collection/tree/rose/zipper.lux | 2 +- stdlib/test/test/lux/data/color.lux | 2 +- stdlib/test/test/lux/data/format/json.lux | 12 ++++++------ stdlib/test/test/lux/data/format/xml.lux | 16 ++++++++-------- stdlib/test/test/lux/data/text/lexer.lux | 8 ++++---- stdlib/test/test/lux/macro/poly/equivalence.lux | 10 +++++----- stdlib/test/test/lux/macro/syntax.lux | 10 +++++----- stdlib/test/test/lux/type.lux | 12 ++++++------ stdlib/test/test/lux/type/check.lux | 2 +- stdlib/test/test/lux/world/binary.lux | 2 +- 14 files changed, 47 insertions(+), 47 deletions(-) (limited to 'stdlib/test') diff --git a/stdlib/test/test/lux/compiler/default/phase/analysis/primitive.lux b/stdlib/test/test/lux/compiler/default/phase/analysis/primitive.lux index ce34ff887..9a5595f22 100644 --- a/stdlib/test/test/lux/compiler/default/phase/analysis/primitive.lux +++ b/stdlib/test/test/lux/compiler/default/phase/analysis/primitive.lux @@ -34,7 +34,7 @@ (r.Random [Type Code]) (`` ($_ r.either (~~ (do-template [ ] - [(r.seq (random/wrap ) (random/map ))] + [(r.and (random/wrap ) (random/map ))] [Any code.tuple (r.list +0 ..unit)] [Bit code.bit r.bit] diff --git a/stdlib/test/test/lux/compiler/default/phase/synthesis/primitive.lux b/stdlib/test/test/lux/compiler/default/phase/synthesis/primitive.lux index 4312f2bae..cdeeea22b 100644 --- a/stdlib/test/test/lux/compiler/default/phase/synthesis/primitive.lux +++ b/stdlib/test/test/lux/compiler/default/phase/synthesis/primitive.lux @@ -23,7 +23,7 @@ (r.Random Analysis) (do r.Monad [primitive (: (r.Random analysis.Primitive) - ($_ r.alt + ($_ r.or (wrap []) r.bit r.nat diff --git a/stdlib/test/test/lux/compiler/default/syntax.lux b/stdlib/test/test/lux/compiler/default/syntax.lux index 8717f03fa..07befa13c 100644 --- a/stdlib/test/test/lux/compiler/default/syntax.lux +++ b/stdlib/test/test/lux/compiler/default/syntax.lux @@ -43,7 +43,7 @@ (def: name^ (r.Random Name) - (r.seq name-part^ name-part^)) + (r.and name-part^ name-part^)) (def: code^ (r.Random Code) @@ -76,7 +76,7 @@ (|> multi^ (r/map code.tuple)) (do r.Monad [size (|> r.nat (r/map (n/% +3)))] - (|> (r.list size (r.seq code^ code^)) + (|> (r.list size (r.and code^ code^)) (r/map code.record)))))] (r.either simple^ composite^)))))) diff --git a/stdlib/test/test/lux/concurrency/promise.lux b/stdlib/test/test/lux/concurrency/promise.lux index 7dda27503..76c5df05c 100644 --- a/stdlib/test/test/lux/concurrency/promise.lux +++ b/stdlib/test/test/lux/concurrency/promise.lux @@ -23,16 +23,16 @@ #1))) (wrap (do &.Monad - [[left right] (&.seq (&.future (io.io #1)) + [[left right] (&.and (&.future (io.io #1)) (&.future (io.io #0)))] (assert "Can combine promises sequentially." (and left (not right))))) (wrap (do &.Monad - [?left (&.alt (&.delay +100 #1) - (&.delay +200 #0)) - ?right (&.alt (&.delay +200 #1) - (&.delay +100 #0))] + [?left (&.or (&.delay +100 #1) + (&.delay +200 #0)) + ?right (&.or (&.delay +200 #1) + (&.delay +100 #0))] (assert "Can combine promises alternatively." (case [?left ?right] [(#.Left #1) (#.Right #0)] diff --git a/stdlib/test/test/lux/data/collection/tree/rose/zipper.lux b/stdlib/test/test/lux/data/collection/tree/rose/zipper.lux index 01ba51e80..8ac987570 100644 --- a/stdlib/test/test/lux/data/collection/tree/rose/zipper.lux +++ b/stdlib/test/test/lux/data/collection/tree/rose/zipper.lux @@ -23,7 +23,7 @@ (do r.Monad ## Each branch can have, at most, 1 child. [size (|> r.nat (:: @ map (n/% +2)))] - (r.seq r.nat + (r.and r.nat (r.list size gen-tree)))))) (def: (to-end zipper) diff --git a/stdlib/test/test/lux/data/color.lux b/stdlib/test/test/lux/data/color.lux index d9555a79c..42d48806a 100644 --- a/stdlib/test/test/lux/data/color.lux +++ b/stdlib/test/test/lux/data/color.lux @@ -11,7 +11,7 @@ (def: color (r.Random @.Color) - (|> ($_ r.seq r.nat r.nat r.nat) + (|> ($_ r.and r.nat r.nat r.nat) (:: r.Monad map @.color))) (def: scale diff --git a/stdlib/test/test/lux/data/format/json.lux b/stdlib/test/test/lux/data/format/json.lux index 60cecbd6d..0f1f6ebce 100644 --- a/stdlib/test/test/lux/data/format/json.lux +++ b/stdlib/test/test/lux/data/format/json.lux @@ -45,7 +45,7 @@ (r.rec (function (_ gen-json) (do r.Monad [size (:: @ map (n/% +2) r.nat)] - ($_ r.alt + ($_ r.or (:: @ wrap []) r.bit (|> r.frac (:: @ map (f/* 1_000_000.0))) @@ -101,8 +101,8 @@ (def: gen-recursive (r.Random Recursive) (r.rec (function (_ gen-recursive) - (r.alt r.frac - (r.seq r.frac gen-recursive))))) + (r.or r.frac + (r.and r.frac gen-recursive))))) (derived: (poly/equivalence.Equivalence Recursive)) @@ -114,15 +114,15 @@ (r.Random Record) (do r.Monad [size (:: @ map (n/% +2) r.nat)] - ($_ r.seq + ($_ r.and r.bit r.frac (r.unicode size) (r.maybe r.frac) (r.list size r.frac) (r.dictionary text.Hash size (r.unicode size) r.frac) - ## ($_ r.alt r.bit (r.unicode size) r.frac) - ## ($_ r.seq r.bit r.frac (r.unicode size)) + ## ($_ r.or r.bit (r.unicode size) r.frac) + ## ($_ r.and r.bit r.frac (r.unicode size)) gen-recursive ## _instant.instant _duration.duration diff --git a/stdlib/test/test/lux/data/format/xml.lux b/stdlib/test/test/lux/data/format/xml.lux index 37eec4169..e1e773a96 100644 --- a/stdlib/test/test/lux/data/format/xml.lux +++ b/stdlib/test/test/lux/data/format/xml.lux @@ -44,19 +44,19 @@ (def: xml-identifier^ (r.Random Name) - (r.seq (xml-text^ +0 +10) + (r.and (xml-text^ +0 +10) (xml-text^ +1 +10))) (def: gen-xml (r.Random &.XML) (r.rec (function (_ gen-xml) - (r.alt (xml-text^ +1 +10) - (do r.Monad - [size (size^ +0 +2)] - ($_ r.seq - xml-identifier^ - (r.dictionary name.Hash size xml-identifier^ (xml-text^ +0 +10)) - (r.list size gen-xml))))))) + (r.or (xml-text^ +1 +10) + (do r.Monad + [size (size^ +0 +2)] + ($_ r.and + xml-identifier^ + (r.dictionary name.Hash size xml-identifier^ (xml-text^ +0 +10)) + (r.list size gen-xml))))))) (context: "XML." (<| (times +100) diff --git a/stdlib/test/test/lux/data/text/lexer.lux b/stdlib/test/test/lux/data/text/lexer.lux index 392b0ccc8..9654c29e6 100644 --- a/stdlib/test/test/lux/data/text/lexer.lux +++ b/stdlib/test/test/lux/data/text/lexer.lux @@ -164,17 +164,17 @@ ($_ seq (test "Can combine lexers sequentially." (and (|> (&.run "YO" - (p.seq &.any &.any)) + (p.and &.any &.any)) (case> (#.Right ["Y" "O"]) #1 _ #0)) (should-fail (&.run "Y" - (p.seq &.any &.any))))) + (p.and &.any &.any))))) (test "Can create the opposite of a lexer." (and (should-passT "a" (&.run "a" - (&.not (p.alt &.decimal &.upper)))) + (&.not (p.or &.decimal &.upper)))) (should-fail (&.run "A" - (&.not (p.alt &.decimal &.upper)))))) + (&.not (p.or &.decimal &.upper)))))) (test "Can select from among a set of characters." (and (should-passT "C" (&.run "C" diff --git a/stdlib/test/test/lux/macro/poly/equivalence.lux b/stdlib/test/test/lux/macro/poly/equivalence.lux index 3e554442b..40dae030c 100644 --- a/stdlib/test/test/lux/macro/poly/equivalence.lux +++ b/stdlib/test/test/lux/macro/poly/equivalence.lux @@ -42,23 +42,23 @@ (def: gen-recursive (r.Random Recursive) (r.rec (function (_ gen-recursive) - (r.alt r.frac - (r.seq r.frac gen-recursive))))) + (r.or r.frac + (r.and r.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.seq + ($_ r.and r.bit gen-int r.frac (r.unicode size) (r.maybe gen-int) (r.list size gen-int) - ($_ r.alt r.bit gen-int r.frac) - ($_ r.seq gen-int r.frac (r.unicode size)) + ($_ r.or r.bit gen-int r.frac) + ($_ r.and gen-int r.frac (r.unicode size)) gen-recursive))) (derived: (&.Equivalence Record)) diff --git a/stdlib/test/test/lux/macro/syntax.lux b/stdlib/test/test/lux/macro/syntax.lux index dfeacb0c6..155f7985a 100644 --- a/stdlib/test/test/lux/macro/syntax.lux +++ b/stdlib/test/test/lux/macro/syntax.lux @@ -105,7 +105,7 @@ [(test (format "Can parse " " syntax.") (and (match [#1 123] (p.run (list ( (list (code.bit #1) (code.int 123)))) - ( (p.seq s.bit s.int)))) + ( (p.and s.bit s.int)))) (match #1 (p.run (list ( (list (code.bit #1)))) ( s.bit))) @@ -113,12 +113,12 @@ ( s.bit))) (match (#.Left #1) (p.run (list ( (list (code.bit #1)))) - ( (p.alt s.bit s.int)))) + ( (p.or s.bit s.int)))) (match (#.Right 123) (p.run (list ( (list (code.int 123)))) - ( (p.alt s.bit s.int)))) + ( (p.or s.bit s.int)))) (fails? (p.run (list ( (list (code.frac 123.0)))) - ( (p.alt s.bit s.int))))))] + ( (p.or s.bit s.int))))))] ["form" s.form code.form] ["tuple" s.tuple code.tuple])] @@ -128,7 +128,7 @@ (test "Can parse record syntax." (match [#1 123] (p.run (list (code.record (list [(code.bit #1) (code.int 123)]))) - (s.record (p.seq s.bit s.int))))) + (s.record (p.and s.bit s.int))))) ))) (context: "Combinators" diff --git a/stdlib/test/test/lux/type.lux b/stdlib/test/test/lux/type.lux index 611f7bd60..1c950eb40 100644 --- a/stdlib/test/test/lux/type.lux +++ b/stdlib/test/test/lux/type.lux @@ -23,17 +23,17 @@ (def: #export gen-name (r.Random Name) - (r.seq gen-short gen-short)) + (r.and gen-short gen-short)) (def: #export gen-type (r.Random Type) (let [(^open "R/.") r.Monad] (r.rec (function (_ gen-type) - (let [pairG (r.seq gen-type gen-type) + (let [pairG (r.and gen-type gen-type) idG r.nat - quantifiedG (r.seq (R/wrap (list)) gen-type)] - ($_ r.alt - (r.seq gen-short (R/wrap (list))) + quantifiedG (r.and (R/wrap (list)) gen-type)] + ($_ r.or + (r.and gen-short (R/wrap (list))) pairG pairG pairG @@ -43,7 +43,7 @@ quantifiedG quantifiedG pairG - (r.seq gen-name gen-type) + (r.and gen-name gen-type) )))))) ## [Tests] diff --git a/stdlib/test/test/lux/type/check.lux b/stdlib/test/test/lux/type/check.lux index b1d0365e1..b801c1cd5 100644 --- a/stdlib/test/test/lux/type/check.lux +++ b/stdlib/test/test/lux/type/check.lux @@ -181,7 +181,7 @@ (do @ [num-connections (|> r.nat (:: @ map (n/% +100))) boundT (|> //.gen-type (r.filter (|>> (case> (#.Var _) #0 _ #1)))) - pick-pcg (r.seq r.nat r.nat)] + pick-pcg (r.and r.nat r.nat)] ($_ seq (test "Can create rings of variables." (type-checks? (do @.Monad diff --git a/stdlib/test/test/lux/world/binary.lux b/stdlib/test/test/lux/world/binary.lux index 25c59c88d..acc3161c1 100644 --- a/stdlib/test/test/lux/world/binary.lux +++ b/stdlib/test/test/lux/world/binary.lux @@ -57,7 +57,7 @@ random-binary (binary binary-size) value r.nat #let [gen-idx (|> r.nat (:: @ map (n/% binary-size)))] - [from to] (r.seq gen-idx gen-idx) + [from to] (r.and gen-idx gen-idx) #let [[from to] [(n/min from to) (n/max from to)]]] ($_ seq ## TODO: De-comment... -- cgit v1.2.3