package batteries

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module BatUCharSource

Unicode characters.

This module implements Unicode characters.

Sourcetype t
Sourceexception Out_of_range
Sourceval char_of : t -> char

char_of u returns the Latin-1 representation of u. If u can not be represented by Latin-1, raises Out_of_range

Sourceval of_char : char -> t

of_char c returns the Unicode character of the Latin-1 character c

Sourceval code : t -> int

code u returns the Unicode code number of u.

Sourceval chr : int -> t

chr n returns the Unicode character with the code number n. If n does not lay in the valid range of Unicode or designates a surrogate character, raises Out_of_range

Sourceval eq : t -> t -> bool

Equality by code point comparison

Sourceval compare : t -> t -> int

compare u1 u2 returns, a value > 0 if u1 has a larger Unicode code number than u2, 0 if u1 and u2 are the same Unicode character, a value < 0 if u1 has a smaller Unicode code number than u2.

Sourcetype uchar = t

Aliases of type t

Sourceval int_of : uchar -> int

Alias of code

Sourceval of_int : int -> uchar

Alias of chr

Sourceval is_ascii : uchar -> bool

true if the char is a regular ascii char, i.e. if its code is <= 127

  • since 2.2.0
OCaml

Innovation. Community. Security.