aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/format
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/format')
-rw-r--r--stdlib/source/format/lux/data/text.lux21
1 files changed, 14 insertions, 7 deletions
diff --git a/stdlib/source/format/lux/data/text.lux b/stdlib/source/format/lux/data/text.lux
index 532edba75..43117912e 100644
--- a/stdlib/source/format/lux/data/text.lux
+++ b/stdlib/source/format/lux/data/text.lux
@@ -16,13 +16,14 @@
[collection
["[0]" list (.use "[1]#[0]" monad)]]]
[math
- ["[0]" modular]
[number
["[0]" nat]
["[0]" int]
["[0]" rev]
["[0]" frac]
- ["[0]" ratio]]]
+ ["[0]" ratio]]
+ [arithmetic
+ ["[0]" modular]]]
[meta
["[0]" location]
["[0]" symbol]
@@ -40,8 +41,9 @@
["[0]" day]
["[0]" month]]]]])
-(.type .public (Format a)
- (-> a Text))
+(.type .public (Format of)
+ (-> of
+ Text))
(def .public functor
(contravariant.Functor Format)
@@ -113,18 +115,23 @@
)
(def .public (mod modular)
- (All (_ m) (Format (modular.Mod m)))
+ (All (_ %)
+ (Format (modular.Mod %)))
(let [codec (modular.codec (modular.modulus modular))]
(of codec encoded modular)))
(def .public (list formatter)
- (All (_ a) (-> (Format a) (Format (List a))))
+ (All (_ of)
+ (-> (Format of)
+ (Format (List of))))
(|>> (list#each (|>> formatter (format " ")))
text.together
(text.enclosed ["(list" ")"])))
(def .public (maybe format)
- (All (_ a) (-> (Format a) (Format (Maybe a))))
+ (All (_ of)
+ (-> (Format of)
+ (Format (Maybe of))))
(function (_ value)
(when value
{.#None}