aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/scriptum.lux
diff options
context:
space:
mode:
authorEduardo Julian2021-08-16 01:12:01 -0400
committerEduardo Julian2021-08-16 01:12:01 -0400
commit3289b9dcf9d5d1c1e5c380e3185065c8fd32535f (patch)
treefc2f67581dd7b1d72c20217a95e031187a375bc5 /stdlib/source/program/scriptum.lux
parent6fd22846f21b8b70b7867e989109d14a366c0a3e (diff)
Made extension-definition macros specify their bindings the same way as syntax:.
Diffstat (limited to 'stdlib/source/program/scriptum.lux')
-rw-r--r--stdlib/source/program/scriptum.lux44
1 files changed, 22 insertions, 22 deletions
diff --git a/stdlib/source/program/scriptum.lux b/stdlib/source/program/scriptum.lux
index ab4c2e787..dbe3ea022 100644
--- a/stdlib/source/program/scriptum.lux
+++ b/stdlib/source/program/scriptum.lux
@@ -95,7 +95,7 @@
(|> lines
(text.all_split_by text.new_line)
(list\map (|>> (format prefix)))
- (text.join_with text.new_line)))
+ (text.interposed text.new_line)))
(def: (pprint_type_definition level type_func_info tags module interface? recursive_type? type)
(-> Nat [Text (List Text)] (List Name) Text Bit Bit Type Text)
@@ -113,7 +113,7 @@
(format "(primitive " (%.text name) ")")
_
- (format "(primitive " (%.text name) " " (|> params (list\map (pprint_type_definition level type_func_info #.None module interface? recursive_type?)) (text.join_with " ")) ")"))
+ (format "(primitive " (%.text name) " " (|> params (list\map (pprint_type_definition level type_func_info #.None module interface? recursive_type?)) (text.interposed " ")) ")"))
[_ (#.Sum _)]
(let [members (type.flat_variant type)]
@@ -122,7 +122,7 @@
(format "(Or "
(|> members
(list\map (pprint_type_definition level type_func_info #.None module interface? recursive_type?))
- (text.join_with " "))
+ (text.interposed " "))
")")
_
@@ -135,18 +135,18 @@
(format "(#" t_name " "
(|> types
(list\map (pprint_type_definition level type_func_info #.None module interface? recursive_type?))
- (text.join_with " "))
+ (text.interposed " "))
")"))
_
(format "(#" t_name " " (pprint_type_definition level type_func_info #.None module interface? recursive_type? type) ")"))))
- (text.join_with text.new_line))))
+ (text.interposed text.new_line))))
[_ (#.Product _)]
(let [members (type.flat_tuple type)]
(case tags
#.End
- (format "[" (|> members (list\map (pprint_type_definition level type_func_info #.None module interface? recursive_type?)) (text.join_with " ")) "]")
+ (format "[" (|> members (list\map (pprint_type_definition level type_func_info #.None module interface? recursive_type?)) (text.interposed " ")) "]")
_
(let [member_docs (|> members
@@ -155,14 +155,14 @@
(if interface?
(format "(: " (pprint_type_definition level type_func_info #.None module interface? recursive_type? type) text.new_line " " t_name ")")
(format "#" t_name " " (pprint_type_definition level type_func_info #.None module interface? recursive_type? type)))))
- (text.join_with (format text.new_line " ")))]
+ (text.interposed (format text.new_line " ")))]
(if interface?
member_docs
(format "{" member_docs "}")))))
[_ (#.Function input output)]
(let [[ins out] (type.flat_function type)]
- (format "(-> " (|> ins (list\map (pprint_type_definition level type_func_info #.None module interface? recursive_type?)) (text.join_with " "))
+ (format "(-> " (|> ins (list\map (pprint_type_definition level type_func_info #.None module interface? recursive_type?)) (text.interposed " "))
" "
(pprint_type_definition level type_func_info #.None module interface? recursive_type? out)
")"))
@@ -181,7 +181,7 @@
(let [[level' body] (<flat> type)
args (level_parameters level level')
body_doc (pprint_type_definition (n.+ level level') type_func_info tags module interface? recursive_type? body)]
- (format "(" <name> " " "[" (text.join_with " " args) "]"
+ (format "(" <name> " " "[" (text.interposed " " args) "]"
(case tags
#.End
(format " " body_doc)
@@ -197,7 +197,7 @@
[_ (#.Apply param fun)]
(let [[type_func type_arguments] (type.flat_application type)]
- (format "(" (pprint_type_definition level type_func_info tags module interface? recursive_type? type_func) " " (|> type_arguments (list\map (pprint_type_definition level type_func_info #.None module interface? recursive_type?)) (text.join_with " ")) ")"))
+ (format "(" (pprint_type_definition level type_func_info tags module interface? recursive_type? type_func) " " (|> type_arguments (list\map (pprint_type_definition level type_func_info #.None module interface? recursive_type?)) (text.interposed " ")) ")"))
[_ (#.Named [_module _name] type)]
(if (text\= module _module)
@@ -214,20 +214,20 @@
(format "(primitive " (%.text name) ")")
_
- (format "(primitive " (%.text name) " " (|> params (list\map (pprint_type level type_func_name module)) (list.interposed " ") (text.join_with "")) ")"))
+ (format "(primitive " (%.text name) " " (|> params (list\map (pprint_type level type_func_name module)) (text.interposed " ")) ")"))
(#.Sum _)
(let [members (type.flat_variant type)]
- (format "(Or " (|> members (list\map (pprint_type level type_func_name module)) (list.interposed " ") (text.join_with "")) ")"))
+ (format "(Or " (|> members (list\map (pprint_type level type_func_name module)) (text.interposed " ")) ")"))
(#.Product _)
(let [members (type.flat_tuple type)]
- (format "[" (|> members (list\map (pprint_type level type_func_name module)) (list.interposed " ") (text.join_with "")) "]"))
+ (format "[" (|> members (list\map (pprint_type level type_func_name module)) (text.interposed " ")) "]"))
(#.Function input output)
(let [[ins out] (type.flat_function type)]
(format "(-> "
- (|> ins (list\map (pprint_type level type_func_name module)) (list.interposed " ") (text.join_with ""))
+ (|> ins (list\map (pprint_type level type_func_name module)) (text.interposed " "))
" "
(pprint_type level type_func_name module out)
")"))
@@ -246,7 +246,7 @@
(let [[level' body] (<flat> type)
args (level_parameters level level')
body_doc (pprint_type (n.+ level level') type_func_name module body)]
- (format "(" <name> " " "[" (|> args (list.interposed " ") (text.join_with "")) "]"
+ (format "(" <name> " " "[" (|> args (text.interposed " ")) "]"
(format " " body_doc)
")"))])
([#.UnivQ "All" type.flat_univ_q]
@@ -254,7 +254,7 @@
(#.Apply param fun)
(let [[type_func type_arguments] (type.flat_application type)]
- (format "(" (pprint_type level type_func_name module type_func) " " (|> type_arguments (list\map (pprint_type level type_func_name module)) (list.interposed " ") (text.join_with "")) ")"))
+ (format "(" (pprint_type level type_func_name module type_func) " " (|> type_arguments (list\map (pprint_type level type_func_name module)) (text.interposed " ")) ")"))
(#.Named [_module _name] type)
(if (text\= module _module)
@@ -363,7 +363,7 @@
_name
_
- (format "(" (text.join_with " " (list& _name type_arguments)) ")"))
+ (format "(" (text.interposed " " (list& _name type_arguments)) ")"))
nesting (list.size type_arguments)]]
(in (md.code (format (if interface? "(interface: " "(type: ")
(if recursive_type? "#rec " "")
@@ -374,7 +374,7 @@
(pprint_type_definition (dec nesting) [_name type_arguments] (maybe.else (list) tags) module interface? recursive_type?)
(text.all_split_by text.new_line)
(list\map (|>> (format " ")))
- (text.join_with text.new_line))
+ (text.interposed text.new_line))
")"))))
_
@@ -433,7 +433,7 @@
name
args
- (format "(" (text.join_with " " (list& name args)) ")"))]
+ (format "(" (text.interposed " " (list& name args)) ")"))]
($_ md.then
(md.heading/3 usage)
(case ?doc
@@ -455,7 +455,7 @@
(|> block
(text.all_split_by text.new_line)
(list\map (text.enclosed pre+post))
- (text.join_with text.new_line)))
+ (text.interposed text.new_line)))
(def: (document_module [[module_name module] organization])
(-> [[Text Module] Organization] (Meta [Text (Markdown Block)]))
@@ -505,9 +505,9 @@
(do {! meta.monad}
[all_modules meta.modules
.let [lux_modules (|> all_modules
- (list.only (function.compose lux_module? product.left))
+ (list.only (function.composite lux_module? product.left))
(list.sorted name_sort))]
- lux_exports (monad.map ! (function.compose meta.exports product.left)
+ lux_exports (monad.map ! (function.composite meta.exports product.left)
lux_modules)
module_documentation (|> (list\map organize_definitions lux_exports)
(list.zipped/2 lux_modules)