package biocaml

  1. Overview
  2. Docs
The OCaml Bioinformatics Library

Install

Dune Dependency

Authors

Maintainers

Sources

v0.10.1.tar.gz
md5=4cf944bcae5d36bf47b67f6bcb2455d7
sha512=0262b5768aefd7c080f664c46c88876fce9a658cc6a87358a77b7112c49ae3042e7ab542e76be5738fbaeda853149b308b48d4897960b5c7ae3b4da71d978bd8

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

Module Biocaml_unix.Line

include module type of Biocaml_base.Line
type t = private Base.string

A line is simply a string, possibly empty, that does not contain a newline character. As the name suggests, usually such strings are obtained by reading a file line by line.

val empty : t
val parse_string : Base.string -> t Base.list

parse_string s splits s on newline characters, returning the resulting list of lines. If the final line ended with a newline, the last string of the list is empty.

val rightmost : Base.string -> Base.string Base.option * t

rightmost s returns a pair whose right member is the longest suffix v of s that represents a line, while the possible remainder of s (minus the newline character) is represented in the left member. More formally, if v = s then the left member of the pair is None; otherwise it is Some u where s = u ^ "\n" ^ v.

val to_string : t -> Base.string
val of_string_unsafe : Base.string -> t

Return the given string without checking that it is a line. Useful for efficiency reasons if you're certain the given string is a line.

Standard String Operations

val is_empty : t -> Base.bool
val lstrip : ?drop:(Base.char -> Base.bool) -> t -> t
val rstrip : ?drop:(Base.char -> Base.bool) -> t -> t
val strip : ?drop:(Base.char -> Base.bool) -> t -> t
val split : t -> on:Base.char -> Base.string Base.list
val for_all : Base.string -> f:(Base.char -> Base.bool) -> Base.bool
val append : t -> t -> t
val concat : ?sep:Base.char -> t Base.list -> t
  • raises [Invalid_arg

    _] if sep = '\n'

S-Expressions

val t_of_sexp : Base.Sexp.t -> t
val sexp_of_t : t -> Base.Sexp.t
OCaml

Innovation. Community. Security.