package batteries

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

Install

Dune Dependency

Authors

Maintainers

Sources

v3.5.0.tar.gz
md5=e4b70d1a716f0aaba36f419f618d0a2e
sha512=a31f1f8cf2c7c3c6c757f3bfae98ff61bb32bab6a1f1e215937df42bcfa447aad41a37edb28d7bcecb88b3838ed8bd57142bcf8e2d28e09bb538055fd8a3b72d

doc/batteries.unthreaded/BatUChar/index.html

Module BatUChar

Unicode characters.

This module implements Unicode characters.

type t
exception Out_of_range
val 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

val of_char : char -> t

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

val code : t -> int

code u returns the Unicode code number of u.

val 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

val eq : t -> t -> bool

Equality by code point comparison

val 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.

type uchar = t

Aliases of type t

val int_of : uchar -> int

Alias of code

val of_int : int -> uchar

Alias of chr

val 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.