package lsp
LSP protocol implementation in OCaml
Install
Dune Dependency
Authors
Maintainers
Sources
jsonrpc-1.6.1.tbz
sha256=bccc0d7194714a4c40c362766ad9095d3c58505a1d4f1dc4becd9b3d1bda8209
sha512=199bee8c74aec6822bc83bf9a7c3757206bdaa55a19cd1f5cf480127618a078baa1e917f6a90a6135a5277e4eb87977e685c10e6503f546997e6b985949e190f
doc/src/lsp.stdune/option.ml.html
Source file option.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 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
# 1 "submodules/dune/otherlibs/stdune-unstable/option.ml" type 'a t = 'a option = | None | Some of 'a module O = struct let ( >>| ) t f = match t with | None -> None | Some a -> Some (f a) let ( >>= ) t f = match t with | None -> None | Some a -> f a let ( let* ) = ( >>= ) let ( let+ ) = ( >>| ) end let map t ~f = O.( >>| ) t f let bind t ~f = O.( >>= ) t f let iter t ~f = match t with | None -> () | Some x -> f x let forall t ~f = match t with | None -> true | Some t -> f t let value t ~default = match t with | Some x -> x | None -> default let value_exn = function | Some x -> x | None -> Code_error.raise "Option.value_exn" [] let some x = Some x let some_if cond x = if cond then Some x else None let is_some = function | None -> false | Some _ -> true let is_none = function | None -> true | Some _ -> false let both x y = match (x, y) with | Some x, Some y -> Some (x, y) | _ -> None let split = function | Some (x, y) -> (Some x, Some y) | None -> (None, None) let to_list = function | None -> [] | Some x -> [ x ] let equal eq x y = match (x, y) with | None, None -> true | Some _, None -> false | None, Some _ -> false | Some sx, Some sy -> eq sx sy let compare cmp x y = match (x, y) with | None, None -> Ordering.Eq | Some _, None -> Gt | None, Some _ -> Lt | Some x, Some y -> cmp x y let try_with f = match f () with | exception _ -> None | s -> Some s module List = struct let all = let rec loop acc = function | [] -> Some (List.rev acc) | None :: _ -> None | Some x :: xs -> loop (x :: acc) xs in fun xs -> loop [] xs end let hash f = function | None -> Stdlib.Hashtbl.hash None | Some s -> Stdlib.Hashtbl.hash (f s) let merge x y ~f = match (x, y) with | None, res -> res | res, None -> res | Some x, Some y -> Some (f x y)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>