aboutsummaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/source/lux/data/text/format.lux7
-rw-r--r--stdlib/source/lux/type.lux14
2 files changed, 13 insertions, 8 deletions
diff --git a/stdlib/source/lux/data/text/format.lux b/stdlib/source/lux/data/text/format.lux
index 743502d11..95dd10914 100644
--- a/stdlib/source/lux/data/text/format.lux
+++ b/stdlib/source/lux/data/text/format.lux
@@ -51,4 +51,9 @@
(def: #export (%list formatter)
(All [a] (-> (Formatter a) (Formatter (List a))))
(lambda [values]
- (format "(list " (text;join-with " " (map formatter values)) ")")))
+ (case values
+ #;Nil
+ "(list)"
+
+ _
+ (format "(list " (text;join-with " " (map formatter values)) ")"))))
diff --git a/stdlib/source/lux/type.lux b/stdlib/source/lux/type.lux
index 91b44bfd8..c81d5e23d 100644
--- a/stdlib/source/lux/type.lux
+++ b/stdlib/source/lux/type.lux
@@ -216,10 +216,10 @@
(#;HostT name params)
(case params
#;Nil
- ($_ Text/append "(^ " name ")")
+ ($_ Text/append "(host " name ")")
_
- ($_ Text/append "(^ " name " " (|> params (List/map to-text) list;reverse (list;interpose " ") (List/fold Text/append "")) ")"))
+ ($_ Text/append "(host " name " " (|> params (List/map to-text) list;reverse (list;interpose " ") (List/fold Text/append "")) ")"))
#;VoidT
"Void"
@@ -262,11 +262,11 @@
(let [[type-fun type-args] (flatten-application type)]
($_ Text/append "(" (to-text type-fun) " " (|> type-args (List/map to-text) list;reverse (list;interpose " ") (List/fold Text/append "")) ")"))
- (#;UnivQ env body)
- ($_ Text/append "(All " (to-text body) ")")
-
- (#;ExQ env body)
- ($_ Text/append "(Ex " (to-text body) ")")
+ (^template [<tag> <desc>]
+ (<tag> env body)
+ ($_ Text/append "(" <desc> " {" (|> env (List/map to-text) (text;join-with " ")) "} " (to-text body) ")"))
+ ([#;UnivQ "All"]
+ [#;ExQ "Ex"])
(#;NamedT [module name] type)
($_ Text/append module ";" name)