package biocaml

  1. Overview
  2. Docs
The OCaml Bioinformatics Library

Install

Dune Dependency

Authors

Maintainers

Sources

biocaml-0.11.2.tbz
sha256=fae219e66db06f81f3fd7d9e44717ccf2d6d85701adb12004ab4ae6d3359dd2d
sha512=f6abd60dac2e02777be81ce3b5acdc0db23b3fa06731f5b2d0b32e6ecc9305fe64f407bbd95a3a9488b14d0a7ac7c41c73a7e18c329a8f18febfc8fd50eccbc6

doc/biocaml.unix/Biocaml_unix/Pos/index.html

Module Biocaml_unix.PosSource

File positions. A position within a file is defined by:

source - Name of the file or other kind of source such as a URL.

line - Line number within the source. The first line is numbered 1. Set to None for binary files where the concept of a line isn't applicable.

offset - If a line number is given, this is the position from the start of the line. The first position is 1. If no line number is given, this is the offset from the beginning of source. The exact semantics of offset depends on the type of source. For example, for Unicode text files, the offset might be the character position instead of a byte position.

It is valid to omit any field. Omitting all fields denotes a dummy or unknown position. Omitting source while providing line or offset is probably not sensible but isn't disallowed. Even if the source is an unnamed entity, some descriptive text should be provided, e.g. "stdin" is better than saying None. Negative values for line and offset also shouldn't be used, but we do not bother disallowing it.

Sourcetype t = {
  1. source : string option;
  2. line : int option;
  3. offset : int option;
}
include Sexplib0.Sexpable.S with type t := t
Sourceval t_of_sexp : Sexplib0.Sexp.t -> t
Sourceval sexp_of_t : t -> Sexplib0.Sexp.t
Sourceval make : ?source:string -> ?line:int -> ?offset:int -> unit -> t
Sourceval unknown : t

Position with all fields set to None.

Sourceval incr_line : ?n:int -> t -> t

incr_line ?n pos increments the line number of pos by n. Default: n = 1. If pos.line = None, it is treated as zero, i.e. the returned line number is set to n.

Sourceval to_string : t -> string

Print string in a human legible format. No particular format is guaranteed.

OCaml

Innovation. Community. Security.