package biocaml
The OCaml Bioinformatics Library
Install
Dune Dependency
Authors
Maintainers
Sources
v0.11.0.tar.gz
md5=486aeb3e552dabae85839e2af30d6c52
sha512=4ed2df0b7cbd80bd6e29bd8fee9d2dacd9379ad0f4ff142bd8e16ade3f1507f6cc7cbe4c614943b8feb8fa4705935695cb458606b0da813dbf255b1e566a43cf
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)"
>