diff options
author | Eduardo Julian | 2018-10-29 21:15:54 -0400 |
---|---|---|
committer | Eduardo Julian | 2018-10-29 21:15:54 -0400 |
commit | 70ffb24d3a0d817080d54e4d3eb4bd49ba18feea (patch) | |
tree | e3fc845552b4feed6924b2190ec8589bccf493de /stdlib/source | |
parent | 5de8734377870637a7757f5aedd13d19cc3c82bb (diff) |
Added "Char" type.
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/data/text.lux | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/stdlib/source/lux/data/text.lux b/stdlib/source/lux/data/text.lux index 18ad49032..2cd6f7980 100644 --- a/stdlib/source/lux/data/text.lux +++ b/stdlib/source/lux/data/text.lux @@ -16,8 +16,10 @@ [compiler ["." host]]]) +(type: #export Char Nat) + (def: #export from-code - (-> Nat Text) + (-> Char Text) (|>> (:coerce Int) "lux int char")) (do-template [<name> <code>] @@ -37,7 +39,7 @@ ("lux text size" x)) (def: #export (nth idx input) - (-> Nat Text (Maybe Nat)) + (-> Nat Text (Maybe Char)) (if (n/< ("lux text size" input) idx) (#.Some ("lux text char" input idx)) #.None)) @@ -245,7 +247,7 @@ (def: #export (space? char) {#.doc "Checks whether the character is white-space."} - (-> Nat Bit) + (-> Char Bit) (`` (case char (^or (^ (char (~~ (static ..tab)))) (^ (char (~~ (static ..vertical-tab)))) |