1Stdlib.Uchar(3) OCaml library Stdlib.Uchar(3)
2
3
4
6 Stdlib.Uchar - no description
7
9 Module Stdlib.Uchar
10
12 Module Uchar
13 : (module Stdlib__uchar)
14
15
16
17
18
19
20
21 type t
22
23
24 The type for Unicode characters.
25
26 A value of this type represents a Unicode scalar value which is an
27 integer in the ranges 0x0000 ... 0xD7FF or 0xE000 ... 0x10FFFF .
28
29
30
31 val min : t
32
33
34 min is U+0000.
35
36
37
38 val max : t
39
40
41 max is U+10FFFF.
42
43
44
45 val bom : t
46
47
48 bom is U+FEFF, the byte order mark (BOM) character.
49
50
51 Since 4.06.0
52
53
54
55 val rep : t
56
57
58 rep is U+FFFD, the replacement character.
59
60
61 Since 4.06.0
62
63
64
65 val succ : t -> t
66
67
68 succ u is the scalar value after u in the set of Unicode scalar values.
69
70
71 Raises Invalid_argument if u is Uchar.max .
72
73
74
75 val pred : t -> t
76
77
78 pred u is the scalar value before u in the set of Unicode scalar val‐
79 ues.
80
81
82 Raises Invalid_argument if u is Uchar.min .
83
84
85
86 val is_valid : int -> bool
87
88
89 is_valid n is true iff n is a Unicode scalar value (i.e. in the ranges
90 0x0000 ... 0xD7FF or 0xE000 ... 0x10FFFF ).
91
92
93
94 val of_int : int -> t
95
96
97 of_int i is i as a Unicode character.
98
99
100 Raises Invalid_argument if i does not satisfy Uchar.is_valid .
101
102
103
104 val to_int : t -> int
105
106
107 to_int u is u as an integer.
108
109
110
111 val is_char : t -> bool
112
113
114 is_char u is true iff u is a latin1 OCaml character.
115
116
117
118 val of_char : char -> t
119
120
121 of_char c is c as a Unicode character.
122
123
124
125 val to_char : t -> char
126
127
128 to_char u is u as an OCaml latin1 character.
129
130
131 Raises Invalid_argument if u does not satisfy Uchar.is_char .
132
133
134
135 val equal : t -> t -> bool
136
137
138 equal u u' is u = u' .
139
140
141
142 val compare : t -> t -> int
143
144
145 compare u u' is Stdlib.compare u u' .
146
147
148
149 val hash : t -> int
150
151
152 hash u associates a non-negative integer to u .
153
154
155
156
157
158OCamldoc 2020-09-01 Stdlib.Uchar(3)