From 46b1f5100b13daa4225ca8a156de7be58f3d8b0a Mon Sep 17 00:00:00 2001
From: Eduardo Julian
Date: Thu, 16 Aug 2018 21:39:04 -0400
Subject: Various fixes.
---
stdlib/source/lux.lux | 40 ++++++++++++++++++++--------------------
1 file changed, 20 insertions(+), 20 deletions(-)
(limited to 'stdlib/source/lux.lux')
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
@@ -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
@@ -5230,19 +5230,19 @@
(def: (doc-example->Text prev-cursor baseline example)
(-> Cursor Nat Code [Cursor Text])
(case example
- (^template [ ]
+ (^template [ ]
[new-cursor ( value)]
- (let [as-text ( value)]
+ (let [as-text ( 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 [ ]
[group-cursor ( parts)]
@@ -5492,7 +5492,7 @@
(with-expansions
[ (do-template [ ]
[(compare )
- (compare (:: Code/encode show ))
+ (compare (:: Code/encode encode ))
(compare #1 (:: Equivalence = ))]
[(bit #1) "#1" [_ (#.Bit #1)]]
--
cgit v1.2.3