aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source
diff options
context:
space:
mode:
Diffstat (limited to '')
-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
35 files changed, 171 insertions, 171 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})