package batteries

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

Install

dune-project
 Dependency

Authors

Maintainers

Sources

batteries-3.10.0.tar.gz
md5=b7f3b99f12f21b1da6b6aa13d993206d
sha512=8b7f2479eb0271bcfd9168887c1e4a9a815c512eab3ee61b150fc4dfa9ec803e4f73115155f20b3017e4a822148d0e6d1c1e8e5f96790fd691b419dd39a908a2

doc/batteries.unthreaded/BatPathGen/module-type-StringType/index.html

Module type BatPathGen.StringTypeSource

This signature lists few basic operations provided by all string types.

The actual implementation may use any (coherent) scheme of indexing of strings. Below the term 'indexing unit' can stay either for byte or character (or whatever employed by the implementation). This determines meaning of all int arguments and results (excluding result of compare).

Sourcetype t

Type for strings.

Sourceval length : t -> int

Length - number of indexing units

Sourcetype tchar

Character type used by t.

Sourceval get : t -> int -> tchar

Usual get function.

Sourceval lift_char : char -> tchar

Convert Latin-1 character to tchar.

Sourceval lift : string -> t

Convert from UTF-8 string of primitive string type.

Sourceval to_string : t -> string

Convert to primitive string with UTF-8 content.

Sourceval concat_with_separators : t -> t list -> t

concat_with_separators sep lst catenates all n elements of lst inserting (n-1) copies of sep in between.

Sourceval compare : t -> t -> int

Usual comparison function.

Sourceval iter : (tchar -> unit) -> t -> unit
Sourceval iteri : (int -> tchar -> unit) -> t -> unit
Sourceval sub : t -> int -> int -> t

As String.sub, but indexed in specific way.

Sourceval rindex : t -> char -> int
Sourcemodule Parse : sig ... end