aboutsummaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
authorEduardo Julian2018-07-21 23:57:21 -0400
committerEduardo Julian2018-07-21 23:57:21 -0400
commit9671d6064dd02dfe6c32492f5b9907b096e5bd89 (patch)
treedb89e3908dedd606ce5838096bc5df9ebcc9b1c4 /stdlib
parent22d10692d87ac1c07fc14f6100917b913bb0f8b3 (diff)
Re-named "seq" to "and" and "alt" to "or".
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/source/lux/cli.lux10
-rw-r--r--stdlib/source/lux/compiler/default/cache.lux8
-rw-r--r--stdlib/source/lux/compiler/default/phase/extension/analysis/host.jvm.lux10
-rw-r--r--stdlib/source/lux/compiler/default/phase/translation/scheme/runtime.jvm.lux4
-rw-r--r--stdlib/source/lux/compiler/default/repl/type.lux6
-rw-r--r--stdlib/source/lux/compiler/default/syntax.lux14
-rw-r--r--stdlib/source/lux/compiler/meta/cache.lux6
-rw-r--r--stdlib/source/lux/concurrency/actor.lux18
-rw-r--r--stdlib/source/lux/concurrency/promise.lux8
-rw-r--r--stdlib/source/lux/control/concatenative.lux6
-rw-r--r--stdlib/source/lux/control/exception.lux6
-rw-r--r--stdlib/source/lux/control/monad/indexed.lux8
-rw-r--r--stdlib/source/lux/control/parser.lux8
-rw-r--r--stdlib/source/lux/control/pipe.lux4
-rw-r--r--stdlib/source/lux/data/collection/tree/rose.lux4
-rw-r--r--stdlib/source/lux/data/format/binary.lux34
-rw-r--r--stdlib/source/lux/data/format/json.lux8
-rw-r--r--stdlib/source/lux/data/format/xml.lux2
-rw-r--r--stdlib/source/lux/data/text/lexer.lux8
-rw-r--r--stdlib/source/lux/data/text/regex.lux18
-rw-r--r--stdlib/source/lux/host.js.lux6
-rw-r--r--stdlib/source/lux/host.jvm.lux48
-rw-r--r--stdlib/source/lux/macro/poly.lux6
-rw-r--r--stdlib/source/lux/macro/poly/equivalence.lux8
-rw-r--r--stdlib/source/lux/macro/poly/json.lux18
-rw-r--r--stdlib/source/lux/macro/syntax/common/reader.lux28
-rw-r--r--stdlib/source/lux/math.lux8
-rw-r--r--stdlib/source/lux/math/modular.lux4
-rw-r--r--stdlib/source/lux/math/random.lux6
-rw-r--r--stdlib/source/lux/time/duration.lux2
-rw-r--r--stdlib/source/lux/type.lux6
-rw-r--r--stdlib/source/lux/type/abstract.lux4
-rw-r--r--stdlib/source/lux/type/implicit.lux4
-rw-r--r--stdlib/source/lux/type/quotient.lux2
-rw-r--r--stdlib/source/lux/type/refinement.lux2
-rw-r--r--stdlib/test/test/lux/compiler/default/phase/analysis/primitive.lux2
-rw-r--r--stdlib/test/test/lux/compiler/default/phase/synthesis/primitive.lux2
-rw-r--r--stdlib/test/test/lux/compiler/default/syntax.lux4
-rw-r--r--stdlib/test/test/lux/concurrency/promise.lux10
-rw-r--r--stdlib/test/test/lux/data/collection/tree/rose/zipper.lux2
-rw-r--r--stdlib/test/test/lux/data/color.lux2
-rw-r--r--stdlib/test/test/lux/data/format/json.lux12
-rw-r--r--stdlib/test/test/lux/data/format/xml.lux16
-rw-r--r--stdlib/test/test/lux/data/text/lexer.lux8
-rw-r--r--stdlib/test/test/lux/macro/poly/equivalence.lux10
-rw-r--r--stdlib/test/test/lux/macro/syntax.lux10
-rw-r--r--stdlib/test/test/lux/type.lux12
-rw-r--r--stdlib/test/test/lux/type/check.lux2
-rw-r--r--stdlib/test/test/lux/world/binary.lux2
49 files changed, 218 insertions, 218 deletions
diff --git a/stdlib/source/lux/cli.lux b/stdlib/source/lux/cli.lux
index fdc1d9365..1ad54189c 100644
--- a/stdlib/source/lux/cli.lux
+++ b/stdlib/source/lux/cli.lux
@@ -99,11 +99,11 @@
(def: program-args^
(Syntax Program-Args)
- (p.alt s.local-identifier
- (s.tuple (p.some (p.either (do p.Monad<Parser>
- [name s.local-identifier]
- (wrap [(code.identifier ["" name]) (` any)]))
- (s.record (p.seq s.any s.any)))))))
+ (p.or s.local-identifier
+ (s.tuple (p.some (p.either (do p.Monad<Parser>
+ [name s.local-identifier]
+ (wrap [(code.identifier ["" name]) (` any)]))
+ (s.record (p.and s.any s.any)))))))
(syntax: #export (program:
{args program-args^}
diff --git a/stdlib/source/lux/compiler/default/cache.lux b/stdlib/source/lux/compiler/default/cache.lux
index d8f841e13..1b5f595fd 100644
--- a/stdlib/source/lux/compiler/default/cache.lux
+++ b/stdlib/source/lux/compiler/default/cache.lux
@@ -6,23 +6,23 @@
(def: definition
(Format Definition)
- ($_ _.seq _.type _.code _.any))
+ ($_ _.and _.type _.code _.any))
(def: alias
(Format [Text Text])
- (_.seq _.text _.text))
+ (_.and _.text _.text))
## TODO: Remove #module-hash, #imports & #module-state ASAP.
## TODO: Not just from this parser, but from the lux.Module type.
(def: #export module
(Format Module)
- ($_ _.seq
+ ($_ _.and
## #module-hash
(_.ignore +0)
## #module-aliases
(_.list ..alias)
## #definitions
- (_.list (_.seq _.text ..definition))
+ (_.list (_.and _.text ..definition))
## #imports
(_.list _.text)
## #tags
diff --git a/stdlib/source/lux/compiler/default/phase/extension/analysis/host.jvm.lux b/stdlib/source/lux/compiler/default/phase/extension/analysis/host.jvm.lux
index 0edd20d2b..7f63118ea 100644
--- a/stdlib/source/lux/compiler/default/phase/extension/analysis/host.jvm.lux
+++ b/stdlib/source/lux/compiler/default/phase/extension/analysis/host.jvm.lux
@@ -1144,7 +1144,7 @@
Handler
(function (_ extension-name analyse args)
(case (: (e.Error [Text Text (List [Text Code])])
- (s.run args ($_ p.seq s.text s.text (p.some (s.tuple (p.seq s.text s.any))))))
+ (s.run args ($_ p.and s.text s.text (p.some (s.tuple (p.and s.text s.any))))))
(#e.Success [class method argsTC])
(do ////.Monad<Operation>
[#let [argsT (list/map product.left argsTC)]
@@ -1161,7 +1161,7 @@
Handler
(function (_ extension-name analyse args)
(case (: (e.Error [Text Text Code (List [Text Code])])
- (s.run args ($_ p.seq s.text s.text s.any (p.some (s.tuple (p.seq s.text s.any))))))
+ (s.run args ($_ p.and s.text s.text s.any (p.some (s.tuple (p.and s.text s.any))))))
(#e.Success [class method objectC argsTC])
(do ////.Monad<Operation>
[#let [argsT (list/map product.left argsTC)]
@@ -1184,7 +1184,7 @@
Handler
(function (_ extension-name analyse args)
(case (: (e.Error [(List Code) [Text Text Code (List [Text Code]) Any]])
- (p.run args ($_ p.seq s.text s.text s.any (p.some (s.tuple (p.seq s.text s.any))) s.end!)))
+ (p.run args ($_ p.and s.text s.text s.any (p.some (s.tuple (p.and s.text s.any))) s.end!)))
(#e.Success [_ [class method objectC argsTC _]])
(do ////.Monad<Operation>
[#let [argsT (list/map product.left argsTC)]
@@ -1201,7 +1201,7 @@
Handler
(function (_ extension-name analyse args)
(case (: (e.Error [Text Text Code (List [Text Code])])
- (s.run args ($_ p.seq s.text s.text s.any (p.some (s.tuple (p.seq s.text s.any))))))
+ (s.run args ($_ p.and s.text s.text s.any (p.some (s.tuple (p.and s.text s.any))))))
(#e.Success [class-name method objectC argsTC])
(do ////.Monad<Operation>
[#let [argsT (list/map product.left argsTC)]
@@ -1222,7 +1222,7 @@
Handler
(function (_ extension-name analyse args)
(case (: (e.Error [Text (List [Text Code])])
- (s.run args ($_ p.seq s.text (p.some (s.tuple (p.seq s.text s.any))))))
+ (s.run args ($_ p.and s.text (p.some (s.tuple (p.and s.text s.any))))))
(#e.Success [class argsTC])
(do ////.Monad<Operation>
[#let [argsT (list/map product.left argsTC)]
diff --git a/stdlib/source/lux/compiler/default/phase/translation/scheme/runtime.jvm.lux b/stdlib/source/lux/compiler/default/phase/translation/scheme/runtime.jvm.lux
index f1a369333..607d922e4 100644
--- a/stdlib/source/lux/compiler/default/phase/translation/scheme/runtime.jvm.lux
+++ b/stdlib/source/lux/compiler/default/phase/translation/scheme/runtime.jvm.lux
@@ -74,8 +74,8 @@
(def: declaration
(s.Syntax [Text (List Text)])
- (p.either (p.seq s.local-identifier (parser/wrap (list)))
- (s.form (p.seq s.local-identifier (p.some s.local-identifier)))))
+ (p.either (p.and s.local-identifier (parser/wrap (list)))
+ (s.form (p.and s.local-identifier (p.some s.local-identifier)))))
(syntax: (runtime: {[name args] declaration}
definition)
diff --git a/stdlib/source/lux/compiler/default/repl/type.lux b/stdlib/source/lux/compiler/default/repl/type.lux
index 4a1cdbe57..b4a8735d8 100644
--- a/stdlib/source/lux/compiler/default/repl/type.lux
+++ b/stdlib/source/lux/compiler/default/repl/type.lux
@@ -65,12 +65,12 @@
[XML %xml]))
(do p.Monad<Parser>
- [[_ elemT] (poly.apply (p.seq (poly.exactly List) poly.any))
+ [[_ elemT] (poly.apply (p.and (poly.exactly List) poly.any))
elemR (poly.local (list elemT) representation)]
(wrap (|>> (:coerce (List Any)) (%list elemR))))
(do p.Monad<Parser>
- [[_ elemT] (poly.apply (p.seq (poly.exactly Maybe) poly.any))
+ [[_ elemT] (poly.apply (p.and (poly.exactly Maybe) poly.any))
elemR (poly.local (list elemT) representation)]
(wrap (|>> (:coerce (Maybe Any))
(case> #.None
@@ -177,7 +177,7 @@
(tuple-representation representation)
(do p.Monad<Parser>
- [[funcT inputsT+] (poly.apply (p.seq poly.any (p.many poly.any)))]
+ [[funcT inputsT+] (poly.apply (p.and poly.any (p.many poly.any)))]
(case (type.apply inputsT+ funcT)
(#.Some outputT)
(poly.local (list outputT) representation)
diff --git a/stdlib/source/lux/compiler/default/syntax.lux b/stdlib/source/lux/compiler/default/syntax.lux
index 20057bf28..e06590f2e 100644
--- a/stdlib/source/lux/compiler/default/syntax.lux
+++ b/stdlib/source/lux/compiler/default/syntax.lux
@@ -204,7 +204,7 @@
(def: rich-digits^
(l.Lexer Text)
- (l.seq l.decimal
+ (l.and l.decimal
(l.some rich-digit)))
(do-template [<name> <tag> <lexer> <codec>]
@@ -221,12 +221,12 @@
[where (<tag> value)]]))))]
[int #.Int
- (l.seq (p.default "" (l.one-of "-"))
+ (l.and (p.default "" (l.one-of "-"))
rich-digits^)
number.Codec<Text,Int>]
[rev #.Rev
- (l.seq (l.one-of ".")
+ (l.and (l.one-of ".")
rich-digits^)
number.Codec<Text,Rev>]
)
@@ -259,7 +259,7 @@
(def: (normal-nat where)
(-> Cursor (l.Lexer [Cursor Code]))
(do p.Monad<Parser>
- [chunk (l.seq (l.one-of "+")
+ [chunk (l.and (l.one-of "+")
rich-digits^)]
(case (:: number.Codec<Text,Nat> decode chunk)
(#.Left error)
@@ -277,13 +277,13 @@
(def: (normal-frac where)
(-> Cursor (l.Lexer [Cursor Code]))
(do p.Monad<Parser>
- [chunk ($_ l.seq
+ [chunk ($_ l.and
(p.default "" (l.one-of "-"))
rich-digits^
(l.one-of ".")
rich-digits^
(p.default ""
- ($_ l.seq
+ ($_ l.and
(l.one-of "eE")
(p.default "" (l.one-of "+-"))
rich-digits^)))]
@@ -305,7 +305,7 @@
(def: (ratio-frac where)
(-> Cursor (l.Lexer [Cursor Code]))
(do p.Monad<Parser>
- [chunk ($_ l.seq
+ [chunk ($_ l.and
(p.default "" (l.one-of "-"))
rich-digits^
(l.one-of "/")
diff --git a/stdlib/source/lux/compiler/meta/cache.lux b/stdlib/source/lux/compiler/meta/cache.lux
index fe9a32266..8c93c65e7 100644
--- a/stdlib/source/lux/compiler/meta/cache.lux
+++ b/stdlib/source/lux/compiler/meta/cache.lux
@@ -99,15 +99,15 @@
## Load
(def: signature
(Format Signature)
- ($_ binary.seq binary.name binary.text))
+ ($_ binary.and binary.name binary.text))
(def: descriptor
(Format Descriptor)
- ($_ binary.seq binary.nat binary.text (binary.list binary.text) (binary.ignore #.Cached)))
+ ($_ binary.and binary.nat binary.text (binary.list binary.text) (binary.ignore #.Cached)))
(def: document
(All [a] (-> (Format a) (Format [Signature Descriptor a])))
- (|>> ($_ binary.seq ..signature ..descriptor)))
+ (|>> ($_ binary.and ..signature ..descriptor)))
(def: (load-document System<m> contexts root key binary module)
(All [m d] (-> (System m) (List File) File (Key d) (Format d) Module
diff --git a/stdlib/source/lux/concurrency/actor.lux b/stdlib/source/lux/concurrency/actor.lux
index 05229b49e..30924c86d 100644
--- a/stdlib/source/lux/concurrency/actor.lux
+++ b/stdlib/source/lux/concurrency/actor.lux
@@ -171,8 +171,8 @@
(def: actor-decl^
(Syntax [Text (List Text)])
- (p.either (s.form (p.seq s.local-identifier (p.some s.local-identifier)))
- (p.seq s.local-identifier (:: p.Monad<Parser> wrap (list)))))
+ (p.either (s.form (p.and s.local-identifier (p.some s.local-identifier)))
+ (p.and s.local-identifier (:: p.Monad<Parser> wrap (list)))))
(do-template [<name> <desc>]
[(def: #export <name>
@@ -195,11 +195,11 @@
(def: behavior^
(s.Syntax BehaviorC)
- (let [handle-args ($_ p.seq s.local-identifier s.local-identifier s.local-identifier)
- stop-args ($_ p.seq s.local-identifier s.local-identifier)]
- (p.seq (p.maybe (s.form (p.seq (s.form (p.after (s.this (' handle)) handle-args))
+ (let [handle-args ($_ p.and s.local-identifier s.local-identifier s.local-identifier)
+ stop-args ($_ p.and s.local-identifier s.local-identifier)]
+ (p.and (p.maybe (s.form (p.and (s.form (p.after (s.this (' handle)) handle-args))
s.any)))
- (p.maybe (s.form (p.seq (s.form (p.after (s.this (' stop)) stop-args))
+ (p.maybe (s.form (p.and (s.form (p.after (s.this (' stop)) stop-args))
s.any))))))
(syntax: #export (actor:
@@ -284,7 +284,7 @@
(def: signature^
(s.Syntax Signature)
- (s.form ($_ p.seq
+ (s.form ($_ p.and
(p.default (list) (s.tuple (p.some s.local-identifier)))
s.local-identifier
(p.some csr.typed-input)
@@ -294,8 +294,8 @@
(def: reference^
(s.Syntax [Name (List Text)])
- (p.either (s.form (p.seq s.identifier (p.some s.local-identifier)))
- (p.seq s.identifier (:: p.Monad<Parser> wrap (list)))))
+ (p.either (s.form (p.and s.identifier (p.some s.local-identifier)))
+ (p.and s.identifier (:: p.Monad<Parser> wrap (list)))))
(syntax: #export (message:
{export csr.export}
diff --git a/stdlib/source/lux/concurrency/promise.lux b/stdlib/source/lux/concurrency/promise.lux
index c68b1fc17..f84b659ff 100644
--- a/stdlib/source/lux/concurrency/promise.lux
+++ b/stdlib/source/lux/concurrency/promise.lux
@@ -1,5 +1,5 @@
(.module:
- [lux #*
+ [lux (#- and or)
[control
[functor (#+ Functor)]
[apply (#+ Apply)]
@@ -108,7 +108,7 @@
mma)
ma))))
-(def: #export (seq left right)
+(def: #export (and left right)
{#.doc "Sequencing combinator."}
(All [a b] (-> (Promise a) (Promise b) (Promise [a b])))
(do Monad<Promise>
@@ -116,7 +116,7 @@
b right]
(wrap [a b])))
-(def: #export (alt left right)
+(def: #export (or left right)
{#.doc "Heterogeneous alternative combinator."}
(All [a b] (-> (Promise a) (Promise b) (Promise (| a b))))
(let [a|b (promise #.None)]
@@ -170,4 +170,4 @@
(def: #export (time-out time-millis promise)
{#.doc "Wait for a promise to be resolved within the specified amount of milliseconds."}
(All [a] (-> Nat (Promise a) (Promise (Maybe a))))
- (alt (wait time-millis) promise))
+ (..or (wait time-millis) promise))
diff --git a/stdlib/source/lux/control/concatenative.lux b/stdlib/source/lux/control/concatenative.lux
index ab3ee39b1..ee4a78e13 100644
--- a/stdlib/source/lux/control/concatenative.lux
+++ b/stdlib/source/lux/control/concatenative.lux
@@ -31,7 +31,7 @@
(def: aliases^
(s.Syntax (List Alias))
- (|> (p.seq s.local-identifier s.any)
+ (|> (p.and s.local-identifier s.any)
p.some
s.record
(p.default (list))))
@@ -42,9 +42,9 @@
(def: stack^
(s.Syntax Stack)
- (p.either (p.seq (p.maybe bottom^)
+ (p.either (p.and (p.maybe bottom^)
(s.tuple (p.some s.any)))
- (p.seq (|> bottom^ (parser/map (|>> #.Some)))
+ (p.and (|> bottom^ (parser/map (|>> #.Some)))
(parser/wrap (list)))))
(def: (stack-fold tops bottom)
diff --git a/stdlib/source/lux/control/exception.lux b/stdlib/source/lux/control/exception.lux
index 86c2a8ddb..2a3cd92c0 100644
--- a/stdlib/source/lux/control/exception.lux
+++ b/stdlib/source/lux/control/exception.lux
@@ -84,8 +84,8 @@
(syntax: #export (exception: {export csr.export}
{t-vars (p.default (list) csr.type-variables)}
- {[name inputs] (p.either (p.seq s.local-identifier (wrap (list)))
- (s.form (p.seq s.local-identifier (p.some csr.typed-input))))}
+ {[name inputs] (p.either (p.and s.local-identifier (wrap (list)))
+ (s.form (p.and s.local-identifier (p.some csr.typed-input))))}
{body (p.maybe s.any)})
{#.doc (doc "Define a new exception type."
"It moslty just serves as a way to tag error messages for later catching."
@@ -126,7 +126,7 @@
($_ text/compose padding header ": " message "\n"))))
(text.join-with ""))))
-(syntax: #export (report {entries (p.many (s.tuple (p.seq s.any s.any)))})
+(syntax: #export (report {entries (p.many (s.tuple (p.and s.any s.any)))})
(wrap (list (` (report' (list (~+ (|> entries
(list/map (function (_ [header message])
(` [(~ header) (~ message)])))))))))))
diff --git a/stdlib/source/lux/control/monad/indexed.lux b/stdlib/source/lux/control/monad/indexed.lux
index af83464d4..ef2acb904 100644
--- a/stdlib/source/lux/control/monad/indexed.lux
+++ b/stdlib/source/lux/control/monad/indexed.lux
@@ -24,7 +24,7 @@
(def: binding
(Syntax Binding)
- (p.seq s.any s.any))
+ (p.and s.any s.any))
(type: Context
(#Let (List Binding))
@@ -32,9 +32,9 @@
(def: context
(Syntax Context)
- (p.alt (p.after (s.this (' #let))
- (s.tuple (p.some binding)))
- binding))
+ (p.or (p.after (s.this (' #let))
+ (s.tuple (p.some binding)))
+ binding))
(def: (pair-list [binding value])
(All [a] (-> [a a] (List a)))
diff --git a/stdlib/source/lux/control/parser.lux b/stdlib/source/lux/control/parser.lux
index 2f25d13da..32ef09784 100644
--- a/stdlib/source/lux/control/parser.lux
+++ b/stdlib/source/lux/control/parser.lux
@@ -1,5 +1,5 @@
(.module:
- [lux (#- not)
+ [lux (#- or and not)
[control
[functor (#+ Functor)]
[apply (#+ Apply)]
@@ -104,7 +104,7 @@
xs (some p)]
(wrap (list& x xs))))
-(def: #export (seq p1 p2)
+(def: #export (and p1 p2)
{#.doc "Sequencing combinator."}
(All [s a b]
(-> (Parser s a) (Parser s b) (Parser s [a b])))
@@ -113,7 +113,7 @@
x2 p2]
(wrap [x1 x2])))
-(def: #export (alt p1 p2)
+(def: #export (or p1 p2)
{#.doc "Heterogeneous alternative combinator."}
(All [s a b]
(-> (Parser s a) (Parser s b) (Parser s (| a b))))
@@ -190,7 +190,7 @@
(#.Some x)
(do @
- [xs' (some (seq sep p))]
+ [xs' (some (..and sep p))]
(wrap (#.Cons x (list/map product.right xs'))))
)))
diff --git a/stdlib/source/lux/control/pipe.lux b/stdlib/source/lux/control/pipe.lux
index a8fefb938..ffdb78575 100644
--- a/stdlib/source/lux/control/pipe.lux
+++ b/stdlib/source/lux/control/pipe.lux
@@ -45,7 +45,7 @@
prev
{else body^}
{_ _reverse_}
- {branches (p.some (p.seq body^ body^))})
+ {branches (p.some (p.and body^ body^))})
{#.doc (doc "Branching for pipes."
"Both the tests and the bodies are piped-code, and must be given inside a tuple."
(|> 5
@@ -130,7 +130,7 @@
[(~+ (list/map (function (_ body) (` (|> (~ g!temp) (~+ body))))
paths))]))))))
-(syntax: #export (case> {branches (p.many (p.seq s.any s.any))}
+(syntax: #export (case> {branches (p.many (p.and s.any s.any))}
prev)
{#.doc (doc "Pattern-matching for pipes."
"The bodies of each branch are NOT pipes; just regular values."
diff --git a/stdlib/source/lux/data/collection/tree/rose.lux b/stdlib/source/lux/data/collection/tree/rose.lux
index 414f44f31..62b65422a 100644
--- a/stdlib/source/lux/data/collection/tree/rose.lux
+++ b/stdlib/source/lux/data/collection/tree/rose.lux
@@ -40,11 +40,11 @@
(def: tree^
(Syntax Tree-Code)
- (|> (|>> p.some s.record (p.seq s.any))
+ (|> (|>> p.some s.record (p.and s.any))
p.rec
p.some
s.record
- (p.seq s.any)
+ (p.and s.any)
s.tuple))
(syntax: #export (tree {root tree^})
diff --git a/stdlib/source/lux/data/format/binary.lux b/stdlib/source/lux/data/format/binary.lux
index 4ea21c30c..b2feda2c5 100644
--- a/stdlib/source/lux/data/format/binary.lux
+++ b/stdlib/source/lux/data/format/binary.lux
@@ -1,5 +1,5 @@
(.module:
- [lux (#- nat int rev list type)
+ [lux (#- and or nat int rev list type)
[control
[monad (#+ do Monad)]
["p" parser]
@@ -86,7 +86,7 @@
)
## Combinators
-(def: #export (alt leftB rightB)
+(def: #export (or leftB rightB)
(All [l r] (-> (Format l) (Format r) (Format (| l r))))
{#read (do p.Monad<Parser>
[flag (get@ #read bits/8)]
@@ -115,9 +115,9 @@
(rightT (.inc offset))))])
))})
-(def: #export (seq preB postB)
+(def: #export (and preB postB)
(All [a b] (-> (Format a) (Format b) (Format [a b])))
- {#read (p.seq (get@ #read preB) (get@ #read postB))
+ {#read (p.and (get@ #read preB) (get@ #read postB))
#write (function (_ [preV postV])
(let [[preS preT] ((get@ #write preB) preV)
[postS postT] ((get@ #write postB) postV)]
@@ -210,29 +210,29 @@
(def: #export maybe
(All [a] (-> (Format a) (Format (Maybe a))))
- (..alt ..any))
+ (..or ..any))
(def: #export (list value)
(All [a] (-> (Format a) (Format (List a))))
(..rec
(function (_ recur)
- (..alt ..any
- (..seq value recur)))))
+ (..or ..any
+ (..and value recur)))))
(def: #export name
(Format Name)
- (..seq ..text ..text))
+ (..and ..text ..text))
(def: #export type
(Format Type)
(..rec
(function (_ type)
- (let [pair (..seq type type)
+ (let [pair (..and type type)
indexed ..nat
- quantified (..seq (..list type) type)]
- ($_ ..alt
+ quantified (..and (..list type) type)]
+ ($_ ..or
## #Primitive
- (..seq ..text (..list type))
+ (..and ..text (..list type))
## #Sum
pair
## #Product
@@ -252,19 +252,19 @@
## #Apply
pair
## #Named
- (..seq ..name type)
+ (..and ..name type)
)))))
(def: #export cursor
(Format Cursor)
- ($_ ..seq ..text ..nat ..nat))
+ ($_ ..and ..text ..nat ..nat))
(def: #export code
(Format Code)
(..rec
(function (_ code)
(let [sequence (..list code)
- code' ($_ ..alt
+ code' ($_ ..or
## #Bit
..bit
## #Nat
@@ -286,5 +286,5 @@
## #Tuple
sequence
## #Record
- (..list (..seq code code)))]
- (..seq ..cursor code')))))
+ (..list (..and code code)))]
+ (..and ..cursor code')))))
diff --git a/stdlib/source/lux/data/format/json.lux b/stdlib/source/lux/data/format/json.lux
index 79510cb5c..02c05f5dd 100644
--- a/stdlib/source/lux/data/format/json.lux
+++ b/stdlib/source/lux/data/format/json.lux
@@ -284,8 +284,8 @@
(def: #export (nullable parser)
(All [a] (-> (Reader a) (Reader (Maybe a))))
- (p.alt null
- parser))
+ (p.or null
+ parser))
(def: #export (array parser)
{#.doc "Parses a JSON array, assuming that every element can be parsed the same way."}
@@ -405,7 +405,7 @@
(def: data-sep
(l.Lexer [Text Any Text])
- ($_ p.seq space~ (l.this ",") space~))
+ ($_ p.and space~ (l.this ",") space~))
(def: null~
(l.Lexer Null)
@@ -502,7 +502,7 @@
(def: (json~' _)
(-> Any (l.Lexer JSON))
- ($_ p.alt null~ boolean~ number~ string~ (array~ json~') (object~ json~')))
+ ($_ p.or null~ boolean~ number~ string~ (array~ json~') (object~ json~')))
(structure: #export _ (Codec Text JSON)
(def: encode show-json)
diff --git a/stdlib/source/lux/data/format/xml.lux b/stdlib/source/lux/data/format/xml.lux
index a990e6901..61215813b 100644
--- a/stdlib/source/lux/data/format/xml.lux
+++ b/stdlib/source/lux/data/format/xml.lux
@@ -99,7 +99,7 @@
(l.Lexer Attrs)
(<| (:: p.Monad<Parser> map (d.from-list name.Hash<Name>))
p.some
- (p.seq (spaced^ attr-name^))
+ (p.and (spaced^ attr-name^))
(p.after (l.this "="))
(spaced^ attr-value^)))
diff --git a/stdlib/source/lux/data/text/lexer.lux b/stdlib/source/lux/data/text/lexer.lux
index bd7a0ff98..6e16ee6ec 100644
--- a/stdlib/source/lux/data/text/lexer.lux
+++ b/stdlib/source/lux/data/text/lexer.lux
@@ -1,5 +1,5 @@
(.module:
- [lux (#- not)
+ [lux (#- or and not)
[control
[monad (#+ do Monad)]
["p" parser]]
@@ -128,8 +128,8 @@
[char any
#let [char' (maybe.assume (text.nth +0 char))]
_ (p.assert ($_ text/compose "Character is not within range: " (text.from-code bottom) "-" (text.from-code top))
- (and (n/>= bottom char')
- (n/<= top char')))]
+ (.and (n/>= bottom char')
+ (n/<= top char')))]
(wrap char)))
(do-template [<name> <bottom> <top> <desc>]
@@ -208,7 +208,7 @@
(Lexer Text)
(satisfies text.space?))
-(def: #export (seq left right)
+(def: #export (and left right)
(-> (Lexer Text) (Lexer Text) (Lexer Text))
(do p.Monad<Parser>
[=left left
diff --git a/stdlib/source/lux/data/text/regex.lux b/stdlib/source/lux/data/text/regex.lux
index b009d9dea..2e4087b23 100644
--- a/stdlib/source/lux/data/text/regex.lux
+++ b/stdlib/source/lux/data/text/regex.lux
@@ -67,10 +67,10 @@
(def: (name^ current-module)
(-> Text (l.Lexer Name))
($_ p.either
- (p.seq (parser/wrap current-module) (p.after (l.this "..") name-part^))
- (p.seq name-part^ (p.after (l.this ".") name-part^))
- (p.seq (parser/wrap "lux") (p.after (l.this ".") name-part^))
- (p.seq (parser/wrap "") name-part^)))
+ (p.and (parser/wrap current-module) (p.after (l.this "..") name-part^))
+ (p.and name-part^ (p.after (l.this ".") name-part^))
+ (p.and (parser/wrap "lux") (p.after (l.this ".") name-part^))
+ (p.and (parser/wrap "") name-part^)))
(def: (re-var^ current-module)
(-> Text (l.Lexer Code))
@@ -231,7 +231,7 @@
(l.enclosed ["{" "}"]
($_ p.either
(do @
- [[from to] (p.seq number^ (p.after (l.this ",") number^))]
+ [[from to] (p.and number^ (p.after (l.this ",") number^))]
(wrap (` ((~! join-text^) (p.between (~ (code.nat from))
(~ (code.nat to))
(~ base))))))
@@ -266,8 +266,8 @@
Text
(l.Lexer [Nat Code]))
(do p.Monad<Parser>
- [parts (p.many (p.alt (re-complex^ current-module)
- (re-scoped^ current-module)))
+ [parts (p.many (p.or (re-complex^ current-module)
+ (re-scoped^ current-module)))
#let [g!total (code.identifier ["" "0total"])
g!temp (code.identifier ["" "0temp"])
[_ names steps] (list/fold (: (-> (Either Code [Re-Group Code])
@@ -313,7 +313,7 @@
(def: (unflatten^ lexer)
(-> (l.Lexer Text) (l.Lexer [Text Any]))
- (p.seq lexer (:: p.Monad<Parser> wrap [])))
+ (p.and lexer (:: p.Monad<Parser> wrap [])))
(def: (|||^ left right)
(All [l r] (-> (l.Lexer [Text l]) (l.Lexer [Text r]) (l.Lexer [Text (| l r)])))
@@ -472,7 +472,7 @@
(wrap (list regex))
)))
-(syntax: #export (^regex {[pattern bindings] (s.form (p.seq s.text (p.maybe s.any)))}
+(syntax: #export (^regex {[pattern bindings] (s.form (p.and s.text (p.maybe s.any)))}
body
{branches (p.many s.any)})
{#.doc (doc "Allows you to test text against regular expressions."
diff --git a/stdlib/source/lux/host.js.lux b/stdlib/source/lux/host.js.lux
index 4958e0d29..d074b1ff1 100644
--- a/stdlib/source/lux/host.js.lux
+++ b/stdlib/source/lux/host.js.lux
@@ -45,7 +45,7 @@
(wrap (list (` (:coerce (~ type)
("js get-field" (~ object) (~ field-name)))))))
-(syntax: #export (object {kvs (p.some (p.seq s.any s.any))})
+(syntax: #export (object {kvs (p.some (p.and s.any s.any))})
{#.doc (doc "A way to create JavaScript objects."
(object)
(object "foo" foo "bar" (inc bar)))}
@@ -72,8 +72,8 @@
[undef "js undefined" "Undefined."]
)
-(syntax: #export (call! {shape (p.alt ($_ p.seq s.any (s.tuple (p.some s.any)) (p.maybe s.any))
- ($_ p.seq s.any s.text (s.tuple (p.some s.any)) (p.maybe s.any)))})
+(syntax: #export (call! {shape (p.or ($_ p.and s.any (s.tuple (p.some s.any)) (p.maybe s.any))
+ ($_ p.and s.any s.text (s.tuple (p.some s.any)) (p.maybe s.any)))})
{#.doc (doc "A way to call JavaScript functions and methods."
(call! (ref "Math.ceil") [123.45])
(call! (ref "Math") "ceil" [123.45]))}
diff --git a/stdlib/source/lux/host.jvm.lux b/stdlib/source/lux/host.jvm.lux
index 1cf76a4dd..cd0eaafed 100644
--- a/stdlib/source/lux/host.jvm.lux
+++ b/stdlib/source/lux/host.jvm.lux
@@ -534,7 +534,7 @@
(do p.Monad<Parser>
[#let [dotted-name (format "::" field-name)]
[_ _ value] (: (Syntax [Any Any Code])
- (s.form ($_ p.seq (s.this (' :=)) (s.this (code.identifier ["" dotted-name])) s.any)))]
+ (s.form ($_ p.and (s.this (' :=)) (s.this (code.identifier ["" dotted-name])) s.any)))]
(wrap (`' ((~ (code.text (format "jvm putfield" ":" class-name ":" field-name))) _jvm_this (~ value))))))
(def: (pre-walk-replace f input)
@@ -640,7 +640,7 @@
(def: privacy-modifier^
(Syntax PrivacyModifier)
(let [(^open ".") p.Monad<Parser>]
- ($_ p.alt
+ ($_ p.or
(s.this (' #public))
(s.this (' #private))
(s.this (' #protected))
@@ -649,15 +649,15 @@
(def: inheritance-modifier^
(Syntax InheritanceModifier)
(let [(^open ".") p.Monad<Parser>]
- ($_ p.alt
+ ($_ p.or
(s.this (' #final))
(s.this (' #abstract))
(wrap []))))
(def: bound-kind^
(Syntax BoundKind)
- (p.alt (s.this (' <))
- (s.this (' >))))
+ (p.or (s.this (' <))
+ (s.this (' >))))
(def: (assert-no-periods name)
(-> Text (Syntax Any))
@@ -750,14 +750,14 @@
(def: annotation-params^
(Syntax (List AnnotationParam))
- (s.record (p.some (p.seq s.local-tag s.any))))
+ (s.record (p.some (p.and s.local-tag s.any))))
(def: (annotation^ imports)
(-> Class-Imports (Syntax Annotation))
(p.either (do p.Monad<Parser>
[ann-name (full-class-name^ imports)]
(wrap [ann-name (list)]))
- (s.form (p.seq (full-class-name^ imports)
+ (s.form (p.and (full-class-name^ imports)
annotation-params^))))
(def: (annotations^' imports)
@@ -800,7 +800,7 @@
(def: state-modifier^
(Syntax StateModifier)
- ($_ p.alt
+ ($_ p.or
(s.this (' #volatile))
(s.this (' #final))
(:: p.Monad<Parser> wrap [])))
@@ -824,7 +824,7 @@
(def: (arg-decl^ imports type-vars)
(-> Class-Imports (List Type-Paramameter) (Syntax ArgDecl))
- (s.tuple (p.seq s.local-identifier
+ (s.tuple (p.and s.local-identifier
(generic-type^ imports type-vars))))
(def: (arg-decls^ imports type-vars)
@@ -833,7 +833,7 @@
(def: (constructor-arg^ imports type-vars)
(-> Class-Imports (List Type-Paramameter) (Syntax ConstructorArg))
- (s.tuple (p.seq (generic-type^ imports type-vars) s.any)))
+ (s.tuple (p.and (generic-type^ imports type-vars) s.any)))
(def: (constructor-args^ imports type-vars)
(-> Class-Imports (List Type-Paramameter) (Syntax (List ConstructorArg)))
@@ -846,7 +846,7 @@
strict-fp? (s.this? (' #strict))
method-vars (p.default (list) (type-params^ imports))
#let [total-vars (list/compose class-vars method-vars)]
- [_ arg-decls] (s.form (p.seq (s.this (' new))
+ [_ arg-decls] (s.form (p.and (s.this (' new))
(arg-decls^ imports total-vars)))
constructor-args (constructor-args^ imports total-vars)
exs (throws-decl^ imports total-vars)
@@ -865,7 +865,7 @@
final? (s.this? (' #final))
method-vars (p.default (list) (type-params^ imports))
#let [total-vars (list/compose class-vars method-vars)]
- [name arg-decls] (s.form (p.seq s.local-identifier
+ [name arg-decls] (s.form (p.and s.local-identifier
(arg-decls^ imports total-vars)))
return-type (generic-type^ imports total-vars)
exs (throws-decl^ imports total-vars)
@@ -883,7 +883,7 @@
owner-class (class-decl^ imports)
method-vars (p.default (list) (type-params^ imports))
#let [total-vars (list/compose (product.right owner-class) method-vars)]
- [name arg-decls] (s.form (p.seq s.local-identifier
+ [name arg-decls] (s.form (p.and s.local-identifier
(arg-decls^ imports total-vars)))
return-type (generic-type^ imports total-vars)
exs (throws-decl^ imports total-vars)
@@ -902,7 +902,7 @@
_ (s.this (' #static))
method-vars (p.default (list) (type-params^ imports))
#let [total-vars method-vars]
- [name arg-decls] (s.form (p.seq s.local-identifier
+ [name arg-decls] (s.form (p.and s.local-identifier
(arg-decls^ imports total-vars)))
return-type (generic-type^ imports total-vars)
exs (throws-decl^ imports total-vars)
@@ -920,7 +920,7 @@
_ (s.this (' #abstract))
method-vars (p.default (list) (type-params^ imports))
#let [total-vars method-vars]
- [name arg-decls] (s.form (p.seq s.local-identifier
+ [name arg-decls] (s.form (p.and s.local-identifier
(arg-decls^ imports total-vars)))
return-type (generic-type^ imports total-vars)
exs (throws-decl^ imports total-vars)
@@ -937,7 +937,7 @@
_ (s.this (' #native))
method-vars (p.default (list) (type-params^ imports))
#let [total-vars method-vars]
- [name arg-decls] (s.form (p.seq s.local-identifier
+ [name arg-decls] (s.form (p.and s.local-identifier
(arg-decls^ imports total-vars)))
return-type (generic-type^ imports total-vars)
exs (throws-decl^ imports total-vars)
@@ -959,7 +959,7 @@
(def: partial-call^
(Syntax Partial-Call)
- (s.form (p.seq s.any s.any)))
+ (s.form (p.and s.any s.any)))
(def: class-kind^
(Syntax Class-Kind)
@@ -979,16 +979,16 @@
(def: (import-member-args^ imports type-vars)
(-> Class-Imports (List Type-Paramameter) (Syntax (List [Bit GenericType])))
- (s.tuple (p.some (p.seq (s.this? (' #?)) (generic-type^ imports type-vars)))))
+ (s.tuple (p.some (p.and (s.this? (' #?)) (generic-type^ imports type-vars)))))
(def: import-member-return-flags^
(Syntax [Bit Bit Bit])
- ($_ p.seq (s.this? (' #io)) (s.this? (' #try)) (s.this? (' #?))))
+ ($_ p.and (s.this? (' #io)) (s.this? (' #try)) (s.this? (' #?))))
(def: primitive-mode^
(Syntax Primitive-Mode)
- (p.alt (s.this (' #manual))
- (s.this (' #auto))))
+ (p.or (s.this (' #manual))
+ (s.this (' #auto))))
(def: (import-member-decl^ imports owner-vars)
(-> Class-Imports (List Type-Paramameter) (Syntax Import-Member-Declaration))
@@ -1017,8 +1017,8 @@
))
(s.form (do p.Monad<Parser>
[kind (: (Syntax ImportMethodKind)
- (p.alt (s.this (' #static))
- (wrap [])))
+ (p.or (s.this (' #static))
+ (wrap [])))
tvars (p.default (list) (type-params^ imports))
name s.local-identifier
?alias import-member-alias^
@@ -2025,7 +2025,7 @@
(def: simple-bindings^
(Syntax (List [Text Code]))
- (s.tuple (p.some (p.seq s.local-identifier s.any))))
+ (s.tuple (p.some (p.and s.local-identifier s.any))))
(syntax: #export (with-open
{bindings simple-bindings^}
diff --git a/stdlib/source/lux/macro/poly.lux b/stdlib/source/lux/macro/poly.lux
index ed9af9cc6..97ec08ff7 100644
--- a/stdlib/source/lux/macro/poly.lux
+++ b/stdlib/source/lux/macro/poly.lux
@@ -213,7 +213,7 @@
[headT any
#let [[inputsT outputT] (type.flatten-function (type.un-name headT))]]
(if (n/> +0 (list.size inputsT))
- (p.seq (local inputsT in-poly)
+ (p.and (local inputsT in-poly)
(local (list outputT) out-poly))
(p.fail (ex.construct not-function headT)))))
@@ -334,7 +334,7 @@
(Poly Code)
(do p.Monad<Parser>
[env ..env
- [funcT argsT] (apply (p.seq any (p.many any)))
+ [funcT argsT] (apply (p.and any (p.many any)))
_ (local (list funcT) (..parameter! +0))
allC (let [allT (list& funcT argsT)]
(|> allT
@@ -384,7 +384,7 @@
(syntax: #export (derived: {export csr.export}
{?name (p.maybe s.local-identifier)}
- {[poly-func poly-args] (s.form (p.seq s.identifier (p.many s.identifier)))}
+ {[poly-func poly-args] (s.form (p.and s.identifier (p.many s.identifier)))}
{?custom-impl (p.maybe s.any)})
(do @
[poly-args (monad.map @ macro.normalize poly-args)
diff --git a/stdlib/source/lux/macro/poly/equivalence.lux b/stdlib/source/lux/macro/poly/equivalence.lux
index 80606aeb2..cb9280506 100644
--- a/stdlib/source/lux/macro/poly/equivalence.lux
+++ b/stdlib/source/lux/macro/poly/equivalence.lux
@@ -59,7 +59,7 @@
## Composite types
(~~ (do-template [<name> <eq>]
[(do @
- [[_ argC] (poly.apply (p.seq (poly.exactly <name>)
+ [[_ argC] (poly.apply (p.and (poly.exactly <name>)
Equivalence<?>))]
(wrap (` (: (~ (@Equivalence inputT))
(<eq> (~ argC))))))]
@@ -73,7 +73,7 @@
[rose.Tree rose.Equivalence<Tree>]
))
(do @
- [[_ _ valC] (poly.apply ($_ p.seq
+ [[_ _ valC] (poly.apply ($_ p.and
(poly.exactly dict.Dictionary)
poly.any
Equivalence<?>))]
@@ -92,7 +92,7 @@
[da.Day da.Equivalence<Day>]
[da.Month da.Equivalence<Month>]))
(do @
- [_ (poly.apply (p.seq (poly.exactly unit.Qty)
+ [_ (poly.apply (p.and (poly.exactly unit.Qty)
poly.any))]
(wrap (` (: (~ (@Equivalence inputT))
unit.Equivalence<Qty>))))
@@ -134,7 +134,7 @@
poly.recursive-self
## Type applications
(do @
- [[funcC argsC] (poly.apply (p.seq Equivalence<?> (p.many Equivalence<?>)))]
+ [[funcC argsC] (poly.apply (p.and Equivalence<?> (p.many Equivalence<?>)))]
(wrap (` ((~ funcC) (~+ argsC)))))
## Parameters
poly.parameter
diff --git a/stdlib/source/lux/macro/poly/json.lux b/stdlib/source/lux/macro/poly/json.lux
index 4217ce704..31ae2fdff 100644
--- a/stdlib/source/lux/macro/poly/json.lux
+++ b/stdlib/source/lux/macro/poly/json.lux
@@ -126,7 +126,7 @@
[#let [g!_ (code.local-identifier "_______")
g!key (code.local-identifier "_______key")
g!val (code.local-identifier "_______val")]
- [_ _ =val=] (poly.apply ($_ p.seq
+ [_ _ =val=] (poly.apply ($_ p.and
(poly.exactly d.Dictionary)
(poly.exactly .Text)
Codec<JSON,?>//encode))]
@@ -137,13 +137,13 @@
(d.from-list text.Hash<Text>)
#//.Object)))))
(do @
- [[_ =sub=] (poly.apply ($_ p.seq
+ [[_ =sub=] (poly.apply ($_ p.and
(poly.exactly .Maybe)
Codec<JSON,?>//encode))]
(wrap (` (: (~ (@JSON//encode inputT))
((~! ..nullable) (~ =sub=))))))
(do @
- [[_ =sub=] (poly.apply ($_ p.seq
+ [[_ =sub=] (poly.apply ($_ p.and
(poly.exactly .List)
Codec<JSON,?>//encode))]
(wrap (` (: (~ (@JSON//encode inputT))
@@ -239,26 +239,26 @@
(wrap (` (: (~ (@JSON//decode inputT))
(p.codec (~! Codec<JSON,Qty>) //.any)))))
(do @
- [[_ _ valC] (poly.apply ($_ p.seq
+ [[_ _ valC] (poly.apply ($_ p.and
(poly.exactly d.Dictionary)
(poly.exactly .Text)
Codec<JSON,?>//decode))]
(wrap (` (: (~ (@JSON//decode inputT))
(//.object (~ valC))))))
(do @
- [[_ subC] (poly.apply (p.seq (poly.exactly .Maybe)
+ [[_ subC] (poly.apply (p.and (poly.exactly .Maybe)
Codec<JSON,?>//decode))]
(wrap (` (: (~ (@JSON//decode inputT))
(//.nullable (~ subC))))))
(do @
- [[_ subC] (poly.apply (p.seq (poly.exactly .List)
+ [[_ subC] (poly.apply (p.and (poly.exactly .List)
Codec<JSON,?>//decode))]
(wrap (` (: (~ (@JSON//decode inputT))
(//.array (p.some (~ subC)))))))
(do @
[members (poly.variant (p.many Codec<JSON,?>//decode))]
(wrap (` (: (~ (@JSON//decode inputT))
- ($_ p.alt
+ ($_ p.or
(~+ (list/map (function (_ [tag memberC])
(` (|> (~ memberC)
(p.after (//.number! (~ (code.frac (..tag tag)))))
@@ -267,7 +267,7 @@
(do @
[g!decoders (poly.tuple (p.many Codec<JSON,?>//decode))]
(wrap (` (: (~ (@JSON//decode inputT))
- (//.array ($_ p.seq (~+ g!decoders)))))))
+ (//.array ($_ p.and (~+ g!decoders)))))))
## Type recursion
(do @
[[selfC bodyC] (poly.recursive Codec<JSON,?>//decode)
@@ -278,7 +278,7 @@
poly.recursive-self
## Type applications
(do @
- [[funcC argsC] (poly.apply (p.seq Codec<JSON,?>//decode (p.many Codec<JSON,?>//decode)))]
+ [[funcC argsC] (poly.apply (p.and Codec<JSON,?>//decode (p.many Codec<JSON,?>//decode)))]
(wrap (` ((~ funcC) (~+ argsC)))))
## Polymorphism
(do @
diff --git a/stdlib/source/lux/macro/syntax/common/reader.lux b/stdlib/source/lux/macro/syntax/common/reader.lux
index fb4238317..0d172fa88 100644
--- a/stdlib/source/lux/macro/syntax/common/reader.lux
+++ b/stdlib/source/lux/macro/syntax/common/reader.lux
@@ -26,16 +26,16 @@
quux
(foo bar baz))}
(Syntax //.Declaration)
- (p.either (p.seq s.local-identifier
+ (p.either (p.and s.local-identifier
(parser/wrap (list)))
- (s.form (p.seq s.local-identifier
+ (s.form (p.and s.local-identifier
(p.many s.local-identifier)))))
## Annotations
(def: #export annotations
{#.doc "Reader for the common annotations syntax used by def: statements."}
(Syntax //.Annotations)
- (s.record (p.some (p.seq s.tag s.any))))
+ (s.record (p.some (p.and s.tag s.any))))
## Definitions
(def: check^
@@ -45,22 +45,22 @@
type s.any
value s.any]
(wrap [(#.Some type) value])))
- (p.seq (parser/wrap #.None)
+ (p.and (parser/wrap #.None)
s.any)))
(def: _definition-anns-tag^
(Syntax Name)
- (s.tuple (p.seq s.text s.text)))
+ (s.tuple (p.and s.text s.text)))
(def: (_definition-anns^ _)
(-> Any (Syntax //.Annotations))
- (p.alt (s.this (' #.Nil))
- (s.form (do p.Monad<Parser>
- [_ (s.this (' #.Cons))
- [head tail] (p.seq (s.tuple (p.seq _definition-anns-tag^ s.any))
- (_definition-anns^ []))]
- (wrap [head tail])))
- ))
+ (p.or (s.this (' #.Nil))
+ (s.form (do p.Monad<Parser>
+ [_ (s.this (' #.Cons))
+ [head tail] (p.and (s.tuple (p.and _definition-anns-tag^ s.any))
+ (_definition-anns^ []))]
+ (wrap [head tail])))
+ ))
(def: (flat-list^ _)
(-> Any (Syntax (List Code)))
@@ -69,7 +69,7 @@
(wrap (list)))
(s.form (do p.Monad<Parser>
[_ (s.this (' #.Cons))
- [head tail] (s.tuple (p.seq s.any s.any))
+ [head tail] (s.tuple (p.and s.any s.any))
tail (s.local (list tail) (flat-list^ []))]
(wrap (#.Cons head tail))))))
@@ -142,7 +142,7 @@
(def: #export typed-input
{#.doc "Reader for the common typed-argument syntax used by many macros."}
(Syntax //.Typed-Input)
- (s.record (p.seq s.any s.any)))
+ (s.record (p.and s.any s.any)))
(def: #export type-variables
{#.doc "Reader for the common type var/param used by many macros."}
diff --git a/stdlib/source/lux/math.lux b/stdlib/source/lux/math.lux
index fea20ba9c..499a83e3e 100644
--- a/stdlib/source/lux/math.lux
+++ b/stdlib/source/lux/math.lux
@@ -191,7 +191,7 @@
(def: infix^
(Syntax Infix)
(<| p.rec (function (_ infix^))
- ($_ p.alt
+ ($_ p.or
($_ p.either
(parser/map code.bit s.bit)
(parser/map code.nat s.nat)
@@ -202,14 +202,14 @@
(parser/map code.identifier s.identifier)
(parser/map code.tag s.tag))
(s.form (p.many s.any))
- (s.tuple (p.seq s.any infix^))
+ (s.tuple (p.and s.any infix^))
(s.tuple ($_ p.either
(do p.Monad<Parser>
[_ (s.this (' #and))
init-subject infix^
init-op s.any
init-param infix^
- steps (p.some (p.seq s.any infix^))]
+ steps (p.some (p.and s.any infix^))]
(wrap (product.right (list/fold (function (_ [op param] [subject [_subject _op _param]])
[param [(#Binary _subject _op _param)
(` and)
@@ -220,7 +220,7 @@
[init-subject infix^
init-op s.any
init-param infix^
- steps (p.some (p.seq s.any infix^))]
+ steps (p.some (p.and s.any infix^))]
(wrap (list/fold (function (_ [op param] [_subject _op _param])
[(#Binary _subject _op _param) op param])
[init-subject init-op init-param]
diff --git a/stdlib/source/lux/math/modular.lux b/stdlib/source/lux/math/modular.lux
index 749eca38b..092b18944 100644
--- a/stdlib/source/lux/math/modular.lux
+++ b/stdlib/source/lux/math/modular.lux
@@ -65,7 +65,7 @@
(def: intL
(Lexer Int)
(p.codec number.Codec<Text,Int>
- (p.either (l.seq (l.one-of "-") (l.many l.decimal))
+ (p.either (l.and (l.one-of "-") (l.many l.decimal))
(l.many l.decimal))))
(abstract: #export (Mod m)
@@ -99,7 +99,7 @@
(def: (decode text)
(<| (l.run text)
(do p.Monad<Parser>
- [[remainder _ _modulus] ($_ p.seq intL (l.this separator) intL)
+ [[remainder _ _modulus] ($_ p.and intL (l.this separator) intL)
_ (p.assert (ex.construct incorrect-modulus [modulus _modulus])
(i/= (to-int modulus) _modulus))]
(wrap (mod modulus remainder))))))
diff --git a/stdlib/source/lux/math/random.lux b/stdlib/source/lux/math/random.lux
index 1d5f426c5..340cb1baa 100644
--- a/stdlib/source/lux/math/random.lux
+++ b/stdlib/source/lux/math/random.lux
@@ -1,5 +1,5 @@
(.module: {#.doc "Pseudo-random number generation (PRNG) algorithms."}
- [lux (#- list i64 nat int rev char)
+ [lux (#- or and list i64 nat int rev char)
[control
[functor (#+ Functor)]
[apply (#+ Apply)]
@@ -154,7 +154,7 @@
[complex c.Complex c.complex frac]
)
-(def: #export (seq left right)
+(def: #export (and left right)
{#.doc "Sequencing combinator."}
(All [a b] (-> (Random a) (Random b) (Random [a b])))
(do Monad<Random>
@@ -162,7 +162,7 @@
=right right]
(wrap [=left =right])))
-(def: #export (alt left right)
+(def: #export (or left right)
{#.doc "Heterogeneous alternative combinator."}
(All [a b] (-> (Random a) (Random b) (Random (| a b))))
(do Monad<Random>
diff --git a/stdlib/source/lux/time/duration.lux b/stdlib/source/lux/time/duration.lux
index 75bb32154..0588d7ba2 100644
--- a/stdlib/source/lux/time/duration.lux
+++ b/stdlib/source/lux/time/duration.lux
@@ -112,7 +112,7 @@
(def: (lex-section suffix)
(-> Text (l.Lexer Int))
(|> (p.codec number.Codec<Text,Int> (l.many l.decimal))
- (p.before (p.seq (l.this suffix) (p.not l.alpha)))
+ (p.before (p.and (l.this suffix) (p.not l.alpha)))
(p.default 0)))
(def: lex-duration
diff --git a/stdlib/source/lux/type.lux b/stdlib/source/lux/type.lux
index 79f13333d..376d40d67 100644
--- a/stdlib/source/lux/type.lux
+++ b/stdlib/source/lux/type.lux
@@ -336,8 +336,8 @@
+0 elem-type
_ (|> elem-type (array (dec level)) (list) (#.Primitive "#Array"))))
-(syntax: #export (:log! {input (p.alt s.identifier
- s.any)})
+(syntax: #export (:log! {input (p.or s.identifier
+ s.any)})
(case input
(#.Left valueN)
(do @
@@ -377,7 +377,7 @@
(def: typed
(Syntax Typed)
- (s.record (p.seq s.any s.any)))
+ (s.record (p.and s.any s.any)))
(syntax: #export (:share {type-vars type-parameters}
{exemplar typed}
diff --git a/stdlib/source/lux/type/abstract.lux b/stdlib/source/lux/type/abstract.lux
index 0c5c0be59..4faea93cf 100644
--- a/stdlib/source/lux/type/abstract.lux
+++ b/stdlib/source/lux/type/abstract.lux
@@ -134,8 +134,8 @@
(def: declaration
(s.Syntax [Text (List Text)])
- (p.either (s.form (p.seq s.local-identifier (p.some s.local-identifier)))
- (p.seq s.local-identifier (:: p.Monad<Parser> wrap (list)))))
+ (p.either (s.form (p.and s.local-identifier (p.some s.local-identifier)))
+ (p.and s.local-identifier (:: p.Monad<Parser> wrap (list)))))
(syntax: #export (abstract:
{export csr.export}
diff --git a/stdlib/source/lux/type/implicit.lux b/stdlib/source/lux/type/implicit.lux
index 8c1718d84..91de1058e 100644
--- a/stdlib/source/lux/type/implicit.lux
+++ b/stdlib/source/lux/type/implicit.lux
@@ -307,8 +307,8 @@
(syntax: #export (:::
{member s.identifier}
- {args (p.alt (p.seq (p.some s.identifier) s.end!)
- (p.seq (p.some s.any) s.end!))})
+ {args (p.or (p.and (p.some s.identifier) s.end!)
+ (p.and (p.some s.any) s.end!))})
{#.doc (doc "Automatic structure selection (for type-class style polymorphism)."
"This feature layers type-class style polymorphism on top of Lux's signatures and structures."
"When calling a polymorphic function, or using a polymorphic constant,"
diff --git a/stdlib/source/lux/type/quotient.lux b/stdlib/source/lux/type/quotient.lux
index 03119d865..17780e622 100644
--- a/stdlib/source/lux/type/quotient.lux
+++ b/stdlib/source/lux/type/quotient.lux
@@ -55,7 +55,7 @@
(<| (poly.run constructor-type)
(do p.Monad<Parser>
[[valueT classT quotient-ex] (<| poly.apply (p.after (poly.exactly ..Class))
- ($_ p.seq poly.any poly.any poly.existential))]
+ ($_ p.and poly.any poly.any poly.existential))]
(wrap (.type (..Quotient valueT classT (:~ (#.Ex quotient-ex))))))))
(syntax: #export (type {quotient s.identifier})
diff --git a/stdlib/source/lux/type/refinement.lux b/stdlib/source/lux/type/refinement.lux
index 01504af3c..1013cf283 100644
--- a/stdlib/source/lux/type/refinement.lux
+++ b/stdlib/source/lux/type/refinement.lux
@@ -89,7 +89,7 @@
(<| (poly.run constructor-type)
(do p.Monad<Parser>
[[un-refinedT refined-ex] (poly.apply (p.after (poly.exactly ..Refiner)
- (p.seq poly.any poly.existential)))]
+ (p.and poly.any poly.existential)))]
(wrap (.type (..Refined un-refinedT (#.Ex refined-ex)))))))
(syntax: #export (type {refinement s.identifier})
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 [<type> <code-wrapper> <value-gen>]
- [(r.seq (random/wrap <type>) (random/map <code-wrapper> <value-gen>))]
+ [(r.and (random/wrap <type>) (random/map <code-wrapper> <value-gen>))]
[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<Random>
[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<Random>
[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<Promise>
- [[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<Promise>
- [?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<Random>
## 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<Random> 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<Random>
[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<Random>
[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<Text> 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<Random>
- [size (size^ +0 +2)]
- ($_ r.seq
- xml-identifier^
- (r.dictionary name.Hash<Name> size xml-identifier^ (xml-text^ +0 +10))
- (r.list size gen-xml)))))))
+ (r.or (xml-text^ +1 +10)
+ (do r.Monad<Random>
+ [size (size^ +0 +2)]
+ ($_ r.and
+ xml-identifier^
+ (r.dictionary name.Hash<Name> 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<Random>
[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 " <type> " syntax.")
(and (match [#1 123]
(p.run (list (<ctor> (list (code.bit #1) (code.int 123))))
- (<parser> (p.seq s.bit s.int))))
+ (<parser> (p.and s.bit s.int))))
(match #1
(p.run (list (<ctor> (list (code.bit #1))))
(<parser> s.bit)))
@@ -113,12 +113,12 @@
(<parser> s.bit)))
(match (#.Left #1)
(p.run (list (<ctor> (list (code.bit #1))))
- (<parser> (p.alt s.bit s.int))))
+ (<parser> (p.or s.bit s.int))))
(match (#.Right 123)
(p.run (list (<ctor> (list (code.int 123))))
- (<parser> (p.alt s.bit s.int))))
+ (<parser> (p.or s.bit s.int))))
(fails? (p.run (list (<ctor> (list (code.frac 123.0))))
- (<parser> (p.alt s.bit s.int))))))]
+ (<parser> (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<Random>]
(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<Check>
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...