package bistro
A library to build and run distributed scientific workflows
Install
Dune Dependency
Authors
Maintainers
Sources
bistro-0.6.0.tbz
sha256=146177faaaa9117a8e2bf0fd60cb658662c0aa992f35beb246e6fd0766050e66
sha512=553fe0c20f236316449b077a47e6e12626d193ba1916e9da233e5526dd39090e8677277e1c79baace3bdc940cb009f25431730a8efc00ae4ed9cc42a0add9609
doc/src/bistro.engine/path.ml.html
Source file path.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
open Core_kernel type t = string list [@@deriving sexp] let compare = List.compare String.compare let rec normalize = function | "." :: t | "" :: t -> normalize t | h :: ".." :: t -> let t = normalize t in if not (String.equal h "..") then t else ".." :: ".." :: t | h :: t -> h :: normalize t | [] -> [] let common_prefix p q = let rec aux res p q = match p, q with | h_p :: t_p, h_q :: t_q when Poly.(h_p = h_q) -> aux (h_p :: res) t_p t_q | _ -> List.rev res, p, q in aux [] p q let of_string x = match String.split ~on:'/' x with | "" :: t -> "/" :: t | xs -> xs let make_relative ?from:(q = Sys.getcwd ()) p = if Filename.is_relative q then invalid_argf "make_rel_path: base %s should be absolute" q () else if Filename.is_relative p then of_string p else let p = normalize (of_string p) and q = normalize (of_string q) in let _, p_suffix, q_suffix = common_prefix p q in List.map q_suffix ~f:(const "..") @ p_suffix let rec to_string = function | [] -> "." | "" :: t -> Filename.concat "." (to_string t) | "/" :: t -> "/" ^ (to_string t) | p -> List.reduce_exn p ~f:Filename.concat
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>