on master help sign in
Updated Unicode Char documentation
2a68244Kyarigwo
libs/prelude/Prelude/Chars.idr+7−2
@@ -1,3 +1,8 @@
1+||| Functions operating over Chars.
2+|||
3+||| The representation of a Char is backend dependent,
4+||| for the C backend, it is a Unicode code point.
5+|||
1module Prelude.Chars
6module Prelude.Chars
2-- Functions operating over Chars
7-- Functions operating over Chars
3
8
@@ -9,7 +14,7 @@ import Builtins
9
14
10%access public export
15%access public export
11
16
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
20
25
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
24
29