package lsp

  1. Overview
  2. Docs
LSP protocol implementation in OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

jsonrpc-1.6.0.tbz
sha256=35e8c7341f8eb1fa39fb0f0e0701a7ed90b9a0bb89ccf84b7ed997cd258cbec3
sha512=c96a7a3ca845ec193e9edc4a74804a22d6e37efc852b54575011879bd2105e0df021408632219f542ca3ad85b36b5c8b72f2b417204d154d5f0dd0839535afa5

doc/lsp.stdune/Stdune/Result/index.html

Module Stdune.ResultSource

Result type

Sourcetype ('a, 'error) t = ('a, 'error) result =
  1. | Ok of 'a
  2. | Error of 'error
Sourceval return : 'a -> ('a, _) t
Sourceval ok : 'a -> ('a, _) t
Sourceval value : ('a, 'e) result -> default:'a -> 'a

value r ~default is v if r is Ok v and default otherwise.

Sourceval is_ok : (_, _) t -> bool
Sourceval is_error : (_, _) t -> bool
Sourceval iter : ('a, _) t -> f:('a -> unit) -> unit
Sourceval ok_exn : ('a, exn) t -> 'a
Sourceval try_with : (unit -> 'a) -> ('a, exn) t
Sourceval equal : ('a -> 'a -> bool) -> ('b -> 'b -> bool) -> ('a, 'b) t -> ('a, 'b) t -> bool
Sourceval hash : ('a -> int) -> ('b -> int) -> ('a, 'b) t -> int
Sourcemodule O : sig ... end
Sourceval map : ('a, 'error) t -> f:('a -> 'b) -> ('b, 'error) t
Sourceval bind : ('a, 'error) t -> f:('a -> ('b, 'error) t) -> ('b, 'error) t
Sourceval (>>=) : ('a, 'error) t -> ('a -> ('b, 'error) t) -> ('b, 'error) t
Sourceval map_error : ('a, 'error1) t -> f:('error1 -> 'error2) -> ('a, 'error2) t
Sourceval to_option : ('a, 'error) t -> 'a option
Sourceval to_dyn : 'a Dyn.Encoder.t -> 'error Dyn.Encoder.t -> ('a, 'error) t Dyn.Encoder.t
Sourceval errorf : ('a, unit, string, (_, string) t) format4 -> 'a

Produce Error <message>

Sourcetype ('a, 'error) result = ('a, 'error) t

For compatibility with some other code

Sourcemodule List : sig ... end
Sourcemodule Option : sig ... end
OCaml

Innovation. Community. Security.