aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/data/text
diff options
context:
space:
mode:
authorEduardo Julian2017-09-19 22:33:54 -0400
committerEduardo Julian2017-09-19 22:33:54 -0400
commit7eb6d767daa24d08d609bad83d82985ffb32c762 (patch)
treed4e3aa54456cbd6d6b58a32789d87234c2d68cfa /stdlib/source/lux/data/text
parent10fba6ef74d8d454f8e8776aa31d2c5cd250909e (diff)
- Changed the terminology of monoids ("append" -> "compose", "unit" -> "identity").
Diffstat (limited to 'stdlib/source/lux/data/text')
-rw-r--r--stdlib/source/lux/data/text/format.lux6
-rw-r--r--stdlib/source/lux/data/text/lexer.lux16
-rw-r--r--stdlib/source/lux/data/text/regex.lux8
3 files changed, 15 insertions, 15 deletions
diff --git a/stdlib/source/lux/data/text/format.lux b/stdlib/source/lux/data/text/format.lux
index d24dbbf59..c434d4637 100644
--- a/stdlib/source/lux/data/text/format.lux
+++ b/stdlib/source/lux/data/text/format.lux
@@ -18,14 +18,14 @@
["s" syntax #+ syntax: Syntax])))
## [Syntax]
-(def: #hidden _append_
+(def: #hidden _compose_
(-> Text Text Text)
- (:: text;Monoid<Text> append))
+ (:: text;Monoid<Text> compose))
(syntax: #export (format [fragments (p;many s;any)])
{#;doc (doc "Text interpolation as a macro."
(format "Static part " (%t static) " does not match URI: " uri))}
- (wrap (list (` ($_ _append_ (~@ fragments))))))
+ (wrap (list (` ($_ _compose_ (~@ fragments))))))
## [Formatters]
(type: #export (Formatter a)
diff --git a/stdlib/source/lux/data/text/lexer.lux b/stdlib/source/lux/data/text/lexer.lux
index cb68fe93d..32ec67ad2 100644
--- a/stdlib/source/lux/data/text/lexer.lux
+++ b/stdlib/source/lux/data/text/lexer.lux
@@ -23,7 +23,7 @@
(def: (unconsumed-input-error offset tape)
(-> Offset Text Text)
- ($_ text/append "Unconsumed input: " (remaining offset tape)))
+ ($_ text/compose "Unconsumed input: " (remaining offset tape)))
(def: #export (run input lexer)
(All [a] (-> Text (Lexer a) (R;Result a)))
@@ -69,7 +69,7 @@
(#R;Success [[(n.+ (text;size reference) offset) tape] []])
_
- (#R;Error ($_ text/append "Could not match: " (text;encode reference) " @ " tape)))))
+ (#R;Error ($_ text/compose "Could not match: " (text;encode reference) " @ " tape)))))
(def: #export (this? reference)
{#;doc "Lex a text if it matches the given sample."}
@@ -120,14 +120,14 @@
(do p;Monad<Parser>
[char any
#let [char' (maybe;assume (text;nth +0 char))]
- _ (p;assert ($_ text/append "Character is not within range: " (text;from-code bottom) "-" (text;from-code top))
+ _ (p;assert ($_ text/compose "Character is not within range: " (text;from-code bottom) "-" (text;from-code top))
(and (n.>= bottom char')
(n.<= top char')))]
(wrap char)))
(do-template [<name> <bottom> <top> <desc>]
[(def: #export <name>
- {#;doc (#;TextA ($_ text/append "Only lex " <desc> " characters."))}
+ {#;doc (#;TextA ($_ text/compose "Only lex " <desc> " characters."))}
(Lexer Text)
(range (char <bottom>) (char <top>)))]
@@ -164,7 +164,7 @@
(let [output (text;from-code output)]
(if (text;contains? output options)
(#R;Success [[(n.inc offset) tape] output])
- (#R;Error ($_ text/append "Character (" output ") is not one of: " options))))
+ (#R;Error ($_ text/compose "Character (" output ") is not one of: " options))))
_
(#R;Error cannot-lex-error))))
@@ -178,7 +178,7 @@
(let [output (text;from-code output)]
(if (;not (text;contains? output options))
(#R;Success [[(n.inc offset) tape] output])
- (#R;Error ($_ text/append "Character (" output ") is one of: " options))))
+ (#R;Error ($_ text/compose "Character (" output ") is one of: " options))))
_
(#R;Error cannot-lex-error))))
@@ -191,7 +191,7 @@
(#;Some output)
(if (p output)
(#R;Success [[(n.inc offset) tape] (text;from-code output)])
- (#R;Error ($_ text/append "Character does not satisfy predicate: " (text;from-code output))))
+ (#R;Error ($_ text/compose "Character does not satisfy predicate: " (text;from-code output))))
_
(#R;Error cannot-lex-error))))
@@ -206,7 +206,7 @@
(do p;Monad<Parser>
[=left left
=right right]
- (wrap ($_ text/append =left =right))))
+ (wrap ($_ text/compose =left =right))))
(do-template [<name> <base> <doc>]
[(def: #export (<name> p)
diff --git a/stdlib/source/lux/data/text/regex.lux b/stdlib/source/lux/data/text/regex.lux
index 6d430b756..2625885b2 100644
--- a/stdlib/source/lux/data/text/regex.lux
+++ b/stdlib/source/lux/data/text/regex.lux
@@ -253,9 +253,9 @@
(re-quantified^ current-module)
(re-simple^ current-module)))
-(def: #hidden _Text/append_
+(def: #hidden _Text/compose_
(-> Text Text Text)
- (:: text;Monoid<Text> append))
+ (:: text;Monoid<Text> compose))
(type: Re-Group
#Non-Capturing
@@ -280,7 +280,7 @@
[idx
names
(list& (list g!temp complex
- (' #let) (` [(~ g!total) (_Text/append_ (~ g!total) (~ g!temp))]))
+ (' #let) (` [(~ g!total) (_Text/compose_ (~ g!total) (~ g!temp))]))
steps)]
(#R;Success [(#Capturing [?name num-captures]) scoped])
@@ -296,7 +296,7 @@
[idx!
(list& name! names)
(list& (list name! scoped
- (' #let) (` [(~ g!total) (_Text/append_ (~ g!total) (~ access))]))
+ (' #let) (` [(~ g!total) (_Text/compose_ (~ g!total) (~ access))]))
steps)])
)))
[0