aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux.lux
diff options
context:
space:
mode:
authorEduardo Julian2018-08-16 21:39:04 -0400
committerEduardo Julian2018-08-16 21:39:04 -0400
commit46b1f5100b13daa4225ca8a156de7be58f3d8b0a (patch)
tree6514ed78424fafc5ea74a9add40e13999a353a25 /stdlib/source/lux.lux
parente4c1b1645fa1a62a0bf8c90723eab7be634dd67f (diff)
Various fixes.
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux.lux40
1 files changed, 20 insertions, 20 deletions
diff --git a/stdlib/source/lux.lux b/stdlib/source/lux.lux
index e5a992052..48540c114 100644
--- a/stdlib/source/lux.lux
+++ b/stdlib/source/lux.lux
@@ -4443,7 +4443,7 @@
_
(list)))
-(def: (type/show type)
+(def: (type/encode type)
(-> Type Text)
(case type
(#Primitive name params)
@@ -4452,16 +4452,16 @@
name
_
- ($_ text/compose "(" name " " (|> params (list/map type/show) (interpose " ") list/reverse (list/fold text/compose "")) ")"))
+ ($_ text/compose "(" name " " (|> params (list/map type/encode) (interpose " ") list/reverse (list/fold text/compose "")) ")"))
(#Sum _)
- ($_ text/compose "(| " (|> (flatten-variant type) (list/map type/show) (interpose " ") list/reverse (list/fold text/compose "")) ")")
+ ($_ text/compose "(| " (|> (flatten-variant type) (list/map type/encode) (interpose " ") list/reverse (list/fold text/compose "")) ")")
(#Product _)
- ($_ text/compose "[" (|> (flatten-tuple type) (list/map type/show) (interpose " ") list/reverse (list/fold text/compose "")) "]")
+ ($_ text/compose "[" (|> (flatten-tuple type) (list/map type/encode) (interpose " ") list/reverse (list/fold text/compose "")) "]")
(#Function _)
- ($_ text/compose "(-> " (|> (flatten-lambda type) (list/map type/show) (interpose " ") list/reverse (list/fold text/compose "")) ")")
+ ($_ text/compose "(-> " (|> (flatten-lambda type) (list/map type/encode) (interpose " ") list/reverse (list/fold text/compose "")) ")")
(#Parameter id)
(nat/encode id)
@@ -4473,16 +4473,16 @@
($_ text/compose "⟨e:" (nat/encode id) "⟩")
(#UnivQ env body)
- ($_ text/compose "(All " (type/show body) ")")
+ ($_ text/compose "(All " (type/encode body) ")")
(#ExQ env body)
- ($_ text/compose "(Ex " (type/show body) ")")
+ ($_ text/compose "(Ex " (type/encode body) ")")
(#Apply _)
(let [[func args] (flatten-app type)]
($_ text/compose
- "(" (type/show func) " "
- (|> args (list/map type/show) (interpose " ") list/reverse (list/fold text/compose ""))
+ "(" (type/encode func) " "
+ (|> args (list/map type/encode) (interpose " ") list/reverse (list/fold text/compose ""))
")"))
(#Named [prefix name] _)
@@ -4507,7 +4507,7 @@
struct-evidence (resolve-type-tags init-type)]
(case struct-evidence
#None
- (fail (text/compose "Can only \"open\" structs: " (type/show init-type)))
+ (fail (text/compose "Can only \"open\" structs: " (type/encode init-type)))
(#Some tags&members)
(do Monad<Meta>
@@ -4667,7 +4667,7 @@
(return (list/join decls')))
_
- (fail (text/compose "Can only \"open:\" structs: " (type/show struct-type)))))
+ (fail (text/compose "Can only \"open:\" structs: " (type/encode struct-type)))))
_
(do Monad<Meta>
@@ -5230,19 +5230,19 @@
(def: (doc-example->Text prev-cursor baseline example)
(-> Cursor Nat Code [Cursor Text])
(case example
- (^template [<tag> <show>]
+ (^template [<tag> <encode>]
[new-cursor (<tag> value)]
- (let [as-text (<show> value)]
+ (let [as-text (<encode> value)]
[(update-cursor new-cursor as-text)
(text/compose (cursor-padding baseline prev-cursor new-cursor)
as-text)]))
- ([#Bit bit/encode]
- [#Nat nat/encode]
- [#Int int/encode]
- [#Frac frac/encode]
- [#Text text/encode]
+ ([#Bit bit/encode]
+ [#Nat nat/encode]
+ [#Int int/encode]
+ [#Frac frac/encode]
+ [#Text text/encode]
[#Identifier name/encode]
- [#Tag tag/encode])
+ [#Tag tag/encode])
(^template [<tag> <open> <close> <prep>]
[group-cursor (<tag> parts)]
@@ -5492,7 +5492,7 @@
(with-expansions
[<tests> (do-template [<expr> <text> <pattern>]
[(compare <pattern> <expr>)
- (compare <text> (:: Code/encode show <expr>))
+ (compare <text> (:: Code/encode encode <expr>))
(compare #1 (:: Equivalence<Code> = <expr> <expr>))]
[(bit #1) "#1" [_ (#.Bit #1)]]