@@ -1,3 +1,8 @@
1+||| Functions operating over Chars.
3+||| The representation of a Char is backend dependent,
4+||| for the C backend, it is a Unicode code point.
1module Prelude.Chars
6module Prelude.Chars
2-- Functions operating over Chars
7-- Functions operating over Chars
@@ -9,7 +14,7 @@ import Builtins
10%access public export
15%access public export
12−||| Convert the number to its Unicode equivalent.
17+||| Convert the number to its backend dependent (usually Unicode) Char equivelent.
13chr : Int -> Char
18chr : Int -> Char
14chr x = if (x >= 0 && x < 0x110000)
19chr x = if (x >= 0 && x < 0x110000)
15 then assert_total (prim__intToChar x)
20 then assert_total (prim__intToChar x)
@@ -18,7 +23,7 @@ chr x = if (x >= 0 && x < 0x110000)
18Cast Int Char where
23Cast Int Char where
19 cast = chr
24 cast = chr
21−||| Return the Unicode representation of the character.
26+||| Return the backend dependent (usually Unicode) numerical equivelent of the Char.
22ord : Char -> Int
27ord : Char -> Int
23ord x = prim__charToInt x
28ord x = prim__charToInt x