package batteries

  1. Overview
  2. Docs
A community-maintained standard library extension

Install

Dune Dependency

Authors

Maintainers

Sources

v3.9.0.tar.gz
md5=ea26b5c72e6731e59d856626049cca4d
sha512=55975b62c26f6db77433a3ac31f97af609fc6789bb62ac38b267249c78fd44ff37fe81901f1cf560857b9493a6046dd37b0d1c0234c66bd59e52843aac3ce6cb

doc/batteries.unthreaded/BatUChar/index.html

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.