aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/data/text/format.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/lux/data/text/format.lux')
-rw-r--r--stdlib/source/lux/data/text/format.lux34
1 files changed, 19 insertions, 15 deletions
diff --git a/stdlib/source/lux/data/text/format.lux b/stdlib/source/lux/data/text/format.lux
index 234a639f2..ca0c7b151 100644
--- a/stdlib/source/lux/data/text/format.lux
+++ b/stdlib/source/lux/data/text/format.lux
@@ -6,13 +6,17 @@
[data
["." bit]
["." name]
- ["." number]
+ [number
+ ["." nat]
+ ["." int]
+ ["." rev]
+ ["." frac]]
["." text]
[format
["." xml]
["." json]]
[collection
- [list ("list/." Monad<List>)]]]
+ [list ("list/." monad)]]]
[time
["." instant]
["." duration]
@@ -40,22 +44,22 @@
(Format <type>)
<formatter>)]
- [%b Bit (:: bit.Codec<Text,Bit> encode)]
- [%n Nat (:: number.Codec<Text,Nat> encode)]
- [%i Int (:: number.Codec<Text,Int> encode)]
- [%r Rev (:: number.Codec<Text,Rev> encode)]
- [%f Frac (:: number.Codec<Text,Frac> encode)]
+ [%b Bit (:: bit.codec encode)]
+ [%n Nat (:: nat.decimal encode)]
+ [%i Int (:: int.decimal encode)]
+ [%r Rev (:: rev.decimal encode)]
+ [%f Frac (:: frac.decimal encode)]
[%t Text text.encode]
- [%name Name (:: name.Codec<Text,Name> encode)]
+ [%name Name (:: name.codec encode)]
[%code Code code.to-text]
[%type Type type.to-text]
- [%bin Nat (:: number.Binary@Codec<Text,Nat> encode)]
- [%oct Nat (:: number.Octal@Codec<Text,Nat> encode)]
- [%hex Nat (:: number.Hex@Codec<Text,Nat> encode)]
- [%xml xml.XML (:: xml.Codec<Text,XML> encode)]
- [%json json.JSON (:: json.Codec<Text,JSON> encode)]
+ [%bin Nat (:: nat.binary encode)]
+ [%oct Nat (:: nat.octal encode)]
+ [%hex Nat (:: nat.hex encode)]
+ [%xml xml.XML (:: xml.codec encode)]
+ [%json json.JSON (:: json.codec encode)]
[%instant instant.Instant instant.to-text]
- [%date date.Date (:: date.Codec<Text,Date> encode)]
+ [%date date.Date (:: date.codec encode)]
)
(def: #export %duration
@@ -71,7 +75,7 @@
(def: #export (%mod modular)
(All [m] (Format (modular.Mod m)))
(let [[_ modulus] (modular.un-mod modular)]
- (:: (modular.Codec<Text,Mod> modulus) encode modular)))
+ (:: (modular.codec modulus) encode modular)))
(def: #export (%list formatter)
(All [a] (-> (Format a) (Format (List a))))