Module BatUChar


module BatUChar: sig .. end
Unicode (ISO-UCS) characters.

This module implements Unicode (actually ISO-UCS) characters. All 31-bit code points are allowed.

Note For conversions to lower/upercase, see modules UTF8 and Rope.
Author(s): Yamagata Yoriyuki (Camomile module), Edgar Friendly, David Teller


val is_whitespace : CamomileLibrary.UChar.t -> bool
Determine if a character is a whitespace.

A character is a whitespace if it is either one of the ASCII whitespaces (characters 9, 10, 12, 13, 26 and 32), or a part of Unicode category Z (separators).

val is_uppercase : CamomileLibrary.UChar.t -> bool
Determine if a character is an uppercase character.
val is_lowercase : CamomileLibrary.UChar.t -> bool
Determine if a character is an lowercase character.
val is_newline : CamomileLibrary.UChar.t -> bool
Determine if a character is a newline. Newline characters are characters 10 ('\r'), 13 (\'n') and characters which are part of Unicode category `Zl
val lowercase : CamomileLibrary.UChar.t -> CamomileLibrary.UChar.t
Convert the given character to its equivalent lowercase character.
val uppercase : CamomileLibrary.UChar.t -> CamomileLibrary.UChar.t
Convert the given character to its equivalent uppercase character.

Conversion functions

val to_char : CamomileLibrary.UChar.t -> char
to_char u returns the Latin-1 representation of u.
Raises Out_of_range if u can not be represented by Latin-1.
val of_digit : int -> CamomileLibrary.UChar.t
Return the character representing a given digit.
Raises Invalid_argument "UChar.of_digit" if the argument is outside the range 0--9
val to_int : CamomileLibrary.UChar.t -> int
Alias of uint_code

Comparaison

val icompare : CamomileLibrary.UChar.t -> CamomileLibrary.UChar.t -> int
Compare two unicode characters, case-insensitive.
module IUChar: BatInterfaces.OrderedType  with type t = t

Detailed information


Determine to which script this character belongs.
type script = [ `Arabic
| `Armenian
| `Bengali
| `Bopomofo
| `Buhid
| `Canadian_Aboriginal
| `Cherokee
| `Common
| `Cyrillic
| `Deseret
| `Devanagari
| `Ethiopic
| `Georgian
| `Gothic
| `Greek
| `Gujarati
| `Gurmukhi
| `Han
| `Hangul
| `Hanunoo
| `Hebrew
| `Hiragana
| `Inherited
| `Kannada
| `Katakana
| `Khmer
| `Lao
| `Latin
| `Malayalam
| `Mongolian
| `Myanmar
| `Ogham
| `Old_Italic
| `Oriya
| `Runic
| `Sinhala
| `Syriac
| `Tagalog
| `Tagbanwa
| `Tamil
| `Telugu
| `Thaana
| `Thai
| `Tibetan
| `Yi ]
val script : CamomileLibrary.UChar.t -> script
type category = [ `Cc
| `Cf
| `Cn
| `Co
| `Cs
| `Ll
| `Lm
| `Lo
| `Lt
| `Lu
| `Mc
| `Me
| `Mn
| `Nd
| `Nl
| `No
| `Pc
| `Pd
| `Pe
| `Pf
| `Pi
| `Po
| `Ps
| `Sc
| `Sk
| `Sm
| `So
| `Zl
| `Zp
| `Zs ]
val category : CamomileLibrary.UChar.t -> category
Determine to which category the character belongs.

Boilerplate code

val print : 'a BatInnerIO.output -> CamomileLibrary.UChar.t -> unit
Printing

val t_printer : CamomileLibrary.UChar.t BatValue_printer.t