package biocaml
The OCaml Bioinformatics Library
Install
Dune Dependency
Authors
Maintainers
Sources
biocaml-0.11.2.tbz
sha256=fae219e66db06f81f3fd7d9e44717ccf2d6d85701adb12004ab4ae6d3359dd2d
sha512=f6abd60dac2e02777be81ce3b5acdc0db23b3fa06731f5b2d0b32e6ecc9305fe64f407bbd95a3a9488b14d0a7ac7c41c73a7e18c329a8f18febfc8fd50eccbc6
doc/src/biocaml.base/line.ml.html
Source file line.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
type t = string [@@deriving sexp] let empty = "" let is_empty l = String.(l = "") let of_string_unsafe = Fn.id let rightmost x = match String.rsplit2 x ~on:'\n' with | None -> (None, x) | Some (b, a) -> (Some b, a) let parse_string s = String.split ~on:'\n' s (* This is adapted from janestreet's Base, slightly more efficient (and less general) *) let split str ~on:c = let len = String.length str in let rec loop acc last_pos pos = if pos = -1 then String.sub str ~pos:0 ~len:last_pos :: acc else if Char.(str.[pos] = c) then let pos1 = pos + 1 in let sub_str = String.sub str ~pos:pos1 ~len:(last_pos - pos1) in loop (sub_str :: acc) pos (pos - 1) else loop acc last_pos (pos - 1) in loop [] len (len - 1) let append x y = x ^ y let to_string = Fn.id let concat ?sep xs = if Caml.(sep = Some '\n') then invalid_arg "Biocaml_base.Line.concat: newline character is not allowed as separator" ; let sep = match sep with | None -> "" | Some c -> String.of_char c in String.concat ~sep xs let lstrip = String.lstrip let rstrip = String.rstrip let strip = String.strip let for_all = String.for_all
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>