aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/scriptum.lux
diff options
context:
space:
mode:
authorEduardo Julian2019-03-15 00:23:49 -0400
committerEduardo Julian2019-03-15 00:23:49 -0400
commitf9d4d316ef9666f6b122b0eec8180351216e95f8 (patch)
tree2a66da0c7552dcb3642ba37afd53f1bef44eef41 /stdlib/source/program/scriptum.lux
parent9449d89f611ba3192373fdeb6848d02707ff1292 (diff)
Changed the convention for the structure opening separator from "/" to ";", to avoid confusion since "/" is used for relative module paths.
Diffstat (limited to 'stdlib/source/program/scriptum.lux')
-rw-r--r--stdlib/source/program/scriptum.lux66
1 files changed, 33 insertions, 33 deletions
diff --git a/stdlib/source/program/scriptum.lux b/stdlib/source/program/scriptum.lux
index a51a1765b..defca9477 100644
--- a/stdlib/source/program/scriptum.lux
+++ b/stdlib/source/program/scriptum.lux
@@ -13,12 +13,12 @@
["." error (#+ Error)]
[format
["md" markdown (#+ Markdown Span Block)]]
- ["." text ("#/." equivalence)
+ ["." text ("#;." equivalence)
format
["." encoding]]
[collection
- ["." sequence (#+ Sequence) ("#/." functor)]
- ["." list ("#/." functor fold)]]]
+ ["." sequence (#+ Sequence) ("#;." functor)]
+ ["." list ("#;." functor fold)]]]
["." function]
["." type]
["." macro]
@@ -44,7 +44,7 @@
(def: type-var-names
(Sequence Text)
- (|> 0 (sequence.iterate inc) (sequence/map parameter-type-name)))
+ (|> 0 (sequence.iterate inc) (sequence;map parameter-type-name)))
(do-template [<name> <partition>]
[(def: (<name> id)
@@ -81,13 +81,13 @@
(|> level
dec
(list.n/range 0)
- (list/map (|>> (n/+ (inc offset)) parameter-type-name)))))
+ (list;map (|>> (n/+ (inc offset)) parameter-type-name)))))
(def: (prefix-lines prefix lines)
(-> Text Text Text)
(|> lines
(text.split-all-with text.new-line)
- (list/map (|>> (format prefix)))
+ (list;map (|>> (format prefix)))
(text.join-with text.new-line)))
(def: (pprint-type-definition level type-func-info tags module signature? recursive-type? type)
@@ -106,7 +106,7 @@
(format "(primitive " (%t name) ")")
_
- (format "(primitive " (%t name) " " (|> params (list/map (pprint-type-definition level type-func-info #.None module signature? recursive-type?)) (text.join-with " ")) ")"))
+ (format "(primitive " (%t name) " " (|> params (list;map (pprint-type-definition level type-func-info #.None module signature? recursive-type?)) (text.join-with " ")) ")"))
[_ (#.Sum _)]
(let [members (type.flatten-variant type)]
@@ -114,20 +114,20 @@
#.Nil
(format "(| "
(|> members
- (list/map (pprint-type-definition level type-func-info #.None module signature? recursive-type?))
+ (list;map (pprint-type-definition level type-func-info #.None module signature? recursive-type?))
(text.join-with " "))
")")
_
(|> members
(list.zip2 tags)
- (list/map (function (_ [[_ t-name] type])
+ (list;map (function (_ [[_ t-name] type])
(case type
(#.Product _)
(let [types (type.flatten-tuple type)]
(format "(#" t-name " "
(|> types
- (list/map (pprint-type-definition level type-func-info #.None module signature? recursive-type?))
+ (list;map (pprint-type-definition level type-func-info #.None module signature? recursive-type?))
(text.join-with " "))
")"))
@@ -139,12 +139,12 @@
(let [members (type.flatten-tuple type)]
(case tags
#.Nil
- (format "[" (|> members (list/map (pprint-type-definition level type-func-info #.None module signature? recursive-type?)) (text.join-with " ")) "]")
+ (format "[" (|> members (list;map (pprint-type-definition level type-func-info #.None module signature? recursive-type?)) (text.join-with " ")) "]")
_
(let [member-docs (|> members
(list.zip2 tags)
- (list/map (function (_ [[_ t-name] type])
+ (list;map (function (_ [[_ t-name] type])
(if signature?
(format "(: " (pprint-type-definition level type-func-info #.None module signature? recursive-type? type) text.new-line " " t-name ")")
(format "#" t-name " " (pprint-type-definition level type-func-info #.None module signature? recursive-type? type)))))
@@ -155,7 +155,7 @@
[_ (#.Function input output)]
(let [[ins out] (type.flatten-function type)]
- (format "(-> " (|> ins (list/map (pprint-type-definition level type-func-info #.None module signature? recursive-type?)) (text.join-with " "))
+ (format "(-> " (|> ins (list;map (pprint-type-definition level type-func-info #.None module signature? recursive-type?)) (text.join-with " "))
" "
(pprint-type-definition level type-func-info #.None module signature? recursive-type? out)
")"))
@@ -190,10 +190,10 @@
[_ (#.Apply param fun)]
(let [[type-func type-arguments] (type.flatten-application type)]
- (format "(" (pprint-type-definition level type-func-info tags module signature? recursive-type? type-func) " " (|> type-arguments (list/map (pprint-type-definition level type-func-info #.None module signature? recursive-type?)) (text.join-with " ")) ")"))
+ (format "(" (pprint-type-definition level type-func-info tags module signature? recursive-type? type-func) " " (|> type-arguments (list;map (pprint-type-definition level type-func-info #.None module signature? recursive-type?)) (text.join-with " ")) ")"))
[_ (#.Named [_module _name] type)]
- (if (text/= module _module)
+ (if (text;= module _module)
_name
(%name [_module _name]))
)))
@@ -207,20 +207,20 @@
(format "(primitive " (%t name) ")")
_
- (format "(primitive " (%t name) " " (|> params (list/map (pprint-type level type-func-name module)) (list.interpose " ") (text.join-with "")) ")"))
+ (format "(primitive " (%t name) " " (|> params (list;map (pprint-type level type-func-name module)) (list.interpose " ") (text.join-with "")) ")"))
(#.Sum _)
(let [members (type.flatten-variant type)]
- (format "(| " (|> members (list/map (pprint-type level type-func-name module)) (list.interpose " ") (text.join-with "")) ")"))
+ (format "(| " (|> members (list;map (pprint-type level type-func-name module)) (list.interpose " ") (text.join-with "")) ")"))
(#.Product _)
(let [members (type.flatten-tuple type)]
- (format "[" (|> members (list/map (pprint-type level type-func-name module)) (list.interpose " ") (text.join-with "")) "]"))
+ (format "[" (|> members (list;map (pprint-type level type-func-name module)) (list.interpose " ") (text.join-with "")) "]"))
(#.Function input output)
(let [[ins out] (type.flatten-function type)]
(format "(-> "
- (|> ins (list/map (pprint-type level type-func-name module)) (list.interpose " ") (text.join-with ""))
+ (|> ins (list;map (pprint-type level type-func-name module)) (list.interpose " ") (text.join-with ""))
" "
(pprint-type level type-func-name module out)
")"))
@@ -247,10 +247,10 @@
(#.Apply param fun)
(let [[type-func type-arguments] (type.flatten-application type)]
- (format "(" (pprint-type level type-func-name module type-func) " " (|> type-arguments (list/map (pprint-type level type-func-name module)) (list.interpose " ") (text.join-with "")) ")"))
+ (format "(" (pprint-type level type-func-name module type-func) " " (|> type-arguments (list;map (pprint-type level type-func-name module)) (list.interpose " ") (text.join-with "")) ")"))
(#.Named [_module _name] type)
- (if (text/= module _module)
+ (if (text;= module _module)
_name
(%name [_module _name]))
))
@@ -268,7 +268,7 @@
(def: (lux-module? module-name)
(-> Text Bit)
- (or (text/= "lux" module-name)
+ (or (text;= "lux" module-name)
(text.starts-with? "lux/" module-name)))
(def: (add-definition [name [def-type def-annotations def-value]] organization)
@@ -299,9 +299,9 @@
(def: name-sort
(All [r] (-> [Text r] [Text r] Bit))
- (let [text/< (:: text.order <)]
+ (let [text;< (:: text.order <)]
(function (_ [n1 _] [n2 _])
- (text/< n1 n2))))
+ (text;< n1 n2))))
(def: (organize-definitions defs)
(-> (List [Text Definition]) Organization)
@@ -309,7 +309,7 @@
#macros (list)
#structures (list)
#values (list)}]
- (|> (list/fold add-definition init defs)
+ (|> (list;fold add-definition init defs)
(update@ #types (list.sort name-sort))
(update@ #macros (list.sort name-sort))
(update@ #structures (list.sort name-sort))
@@ -363,7 +363,7 @@
(when> recursive-type? [unrecurse-type])
(pprint-type-definition (dec nesting) [_name type-arguments] (maybe.default (list) tags) module signature? recursive-type?)
(text.split-all-with text.new-line)
- (list/map (|>> (format " ")))
+ (list;map (|>> (format " ")))
(text.join-with text.new-line))
")"))))
@@ -389,14 +389,14 @@
md.empty)
type-code)))))
types)]
- (wrap (list/fold (function.flip md.then)
+ (wrap (list;fold (function.flip md.then)
(md.heading/2 "Types")
type-docs))))
(def: (document-macros module-name names)
(-> Text (List [Text Code]) (Markdown Block))
(|> names
- (list/map (: (-> [Text Code] (Markdown Block))
+ (list;map (: (-> [Text Code] (Markdown Block))
(function (_ [name def-annotations])
($_ md.then
(md.heading/3 name)
@@ -405,7 +405,7 @@
(do maybe.monad
[documentation (macro.get-documentation def-annotations)]
(wrap (md.code documentation))))))))
- (list/fold (function.flip md.then)
+ (list;fold (function.flip md.then)
(md.heading/2 "Macros"))))
(do-template [<singular> <plural> <header>]
@@ -416,7 +416,7 @@
(def: (<plural> module values)
(-> Text (List Value) (Markdown Block))
(|> values
- (list/map (function (_ [name def-annotations value-type])
+ (list;map (function (_ [name def-annotations value-type])
(let [?doc (macro.get-documentation def-annotations)
usage (case (macro.function-arguments def-annotations)
#.Nil
@@ -433,7 +433,7 @@
_
md.empty)
(<singular> module value-type)))))
- (list/fold (function.flip md.then)
+ (list;fold (function.flip md.then)
(md.heading/2 <header>))))]
[document-structure document-structures "Structures"]
@@ -444,7 +444,7 @@
(-> [Text Text] Text Text)
(|> block
(text.split-all-with text.new-line)
- (list/map (text.enclose pre+post))
+ (list;map (text.enclose pre+post))
(text.join-with text.new-line)))
(def: (document-module [[module-name module] organization])
@@ -502,7 +502,7 @@
(list.sort name-sort))]
lux-exports (monad.map @ (function.compose macro.exports product.left)
lux-modules)
- module-documentation (|> (list/map organize-definitions lux-exports)
+ module-documentation (|> (list;map organize-definitions lux-exports)
(list.zip2 lux-modules)
(monad.map @ document-module))
#let [_ (io.run (monad.map io.monad save-documentation! module-documentation))]]