From 70ffb24d3a0d817080d54e4d3eb4bd49ba18feea Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 29 Oct 2018 21:15:54 -0400 Subject: Added "Char" type. --- stdlib/source/lux/data/text.lux | 8 +++++--- 1 file 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 [ ] @@ -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)))) -- cgit v1.2.3