package grace
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
A fancy diagnostics library that allows your compilers to exit with grace
Install
dune-project
Dependency
Authors
Maintainers
Sources
grace-0.4.0.tbz
sha256=388149857c0fbaf2489b1e396af25aadd6185998847b75570f9198a077ad1ace
sha512=9ffa701f7729f90976594c4ec77b968f15450d8d7a1f0c65fe60d092c136b18f1c8bbd5f5772a651c925dabcdc82ac7023c30a4caa1b94e3e158ef2efa34b85e
doc/src/grace.std/list.ml.html
Source file list.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 53 54 55 56 57 58 59 60 61 62 63(* Added in OCaml 5.1 *) let[@warning "-32"] is_empty t = match t with | [] -> true | _ :: _ -> false ;; include Stdlib.StdLabels.List let pp ?pp_sep pp_elt = Format.pp_print_list ?pp_sep pp_elt let sexp_of_t = Sexplib.Std.sexp_of_list let t_of_sexp = Sexplib.Std.list_of_sexp let sort t ~compare = sort t ~cmp:compare let stable_sort t ~compare = stable_sort t ~cmp:compare let hd_exn = hd let hd t = match t with | [] -> None | x :: _ -> Some x ;; let rec last t = match t with | [] -> None | [ x ] -> Some x | _ :: t -> last t ;; let count t ~f = fold_left t ~init:0 ~f:(fun acc x -> if f x then acc + 1 else acc) let max_elt t ~compare = match t with | [] -> None | elt :: t -> Some (fold_left t ~init:elt ~f:(fun acc elt -> if compare acc elt < 0 then elt else acc)) ;; let group t ~break = let t = ref t in let[@tail_mod_cons] rec take_group () = match !t with | ([] | [ _ ]) as group -> t := []; group | x :: (y :: _ as tl) -> t := tl; if break x y then [ x ] else x :: take_group () in let[@tail_mod_cons] rec groups () = if is_empty !t then [] else ( let group = take_group () in group :: groups ()) in groups () ;; let sort_and_group t ~compare = t |> stable_sort ~compare |> group ~break:(fun x y -> compare x y <> 0) ;;
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>