diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux.lux | 40 |
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)]] |