Source file char_u.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
type t = char#
external of_int8_u : int8# -> char# @@ portable = "%identity"
external to_int8_u : char# -> int8# @@ portable = "%identity"
let code c = Int8_u.unsigned_to_int (to_int8_u c)
let to_char c = Char.chr (code c)
let of_char c = of_int8_u (Int8_u.of_int (Char.code c))
let chr i = of_char (Char.chr i)
let escaped c = Char.escaped (to_char c)
let lowercase_ascii c = of_char (Char.lowercase_ascii (to_char c))
let uppercase_ascii c = of_char (Char.uppercase_ascii (to_char c))
let equal c d = Int8_u.equal (to_int8_u c) (to_int8_u d)
let compare c d = Int8_u.unsigned_compare (to_int8_u c) (to_int8_u d)
let seeded_hash seed c = Int.seeded_hash seed (code c)
let hash c = Int.hash (code c)