package lsp
LSP protocol implementation in OCaml
Install
Dune Dependency
Authors
Maintainers
Sources
jsonrpc-1.4.0.tbz
sha256=fd138e6c4fcff32c6d15eb66cc9391b7e1183717a6d1a47c688c7f6d320a159f
sha512=567a73b3c10bb59c5a4d4e8291d1aeefdfd34438a95313fba8a485638294ca5fb8034334719631243c304d3328c27afa90dfd564fdb1e7390507a06db3a4ad03
doc/src/lsp.stdune/set.ml.html
Source file set.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 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
module type S = Set_intf.S module Make (Key : Map_intf.Key) (M : Map_intf.S with type key = Key.t) = struct include Stdlib.MoreLabels.Set.Make (struct type t = Key.t let compare x y = Ordering.to_int (Key.compare x y) end) type 'a map = 'a M.t let to_list = elements let mem t x = mem x t let add t x = add x t let remove t x = remove x t let compare a b = Ordering.of_int (compare a b) let is_subset t ~of_ = subset t of_ let iter t ~f = iter t ~f let map t ~f = map t ~f let fold t ~init ~f = fold t ~init ~f let for_all t ~f = for_all t ~f let exists t ~f = exists t ~f let filter t ~f = filter t ~f let partition t ~f = partition t ~f let min_elt = min_elt_opt let max_elt = max_elt_opt let choose = choose_opt let split x t = split t x let union_map l ~f = List.fold_left ~init:empty l ~f:(fun acc x -> let s = f x in union acc s) let union_all l = union_map l ~f:(fun x -> x) exception Found of elt let find t ~f = match iter t ~f:(fun e -> if f e then raise_notrace (Found e) else ()) with | () -> None | exception Found e -> Some e let to_dyn t = Dyn.Set (to_list t |> List.map ~f:Key.to_dyn) let choose_exn t = match choose t with | Some e -> e | None -> Code_error.raise "Set.choose_exn" [ ("t", to_dyn t) ] let of_keys = M.foldi ~init:empty ~f:(fun k _ acc -> add acc k) let to_map = fold ~init:M.empty ~f:(fun k acc -> M.set acc k ()) let of_list_map xs ~f = (* We don't [fold_left] & [add] over [xs] because [of_list] has a specialized implementation *) List.map xs ~f |> of_list end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>