package kappa-library

  1. Overview
  2. Docs
Public internals of the Kappa tool suite. Use this package to use kappa as a lib

Install

Dune Dependency

Authors

Maintainers

Sources

v4.1.3.tar.gz
md5=1c9a8a0d79f085757817f90834e166f5
sha512=13ac40442940ba6e72d7dc5bf952e67443872f7bff63e9c76a3a699a6904c88696047fe04519b7ec6546371642f6ee7b0983117be302694aca15500b0df40de3

doc/kappa-library.generic/Kappa_data_structures/Result_util/index.html

Module Kappa_data_structures.Result_utilSource

Sourcetype status = [
  1. | `OK
  2. | `Accepted
  3. | `Created
  4. | `Bad_request
  5. | `Conflict
  6. | `Not_found
  7. | `Request_timeout
]

The subset of Cohttp.Code.status we need

Sourcetype message = {
  1. severity : Logs.level;
  2. text : string;
  3. range : Loc.t option;
}
Sourcetype ('a, 'b) t = {
  1. value : ('a, 'b) Result.result;
  2. status : status;
}
Sourceval write_message : Buffer.t -> message -> unit
Sourceval print_message : Format.formatter -> message -> unit
Sourceval write_t : (Buffer.t -> 'ok -> unit) -> (Buffer.t -> 'error -> unit) -> Buffer.t -> ('ok, 'error) t -> unit

Output a JSON value of type t.

Sourceval string_of_t : (Buffer.t -> 'ok -> unit) -> (Buffer.t -> 'error -> unit) -> ?len:int -> ('ok, 'error) t -> string

Serialize a value of type t into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

Input JSON data of type t.

Sourceval t_of_string : (Yojson.Safe.lexer_state -> Lexing.lexbuf -> 'ok) -> (Yojson.Safe.lexer_state -> Lexing.lexbuf -> 'error) -> string -> ('ok, 'error) t

Deserialize JSON data of type t.

Sourceval lift : ?ok_status:status -> ?error_status:status -> ('a, 'b) Result.result -> ('a, 'b) t
Sourceval fold : ok:('ok -> 'a) -> error:('error -> 'a) -> ('ok, 'error) t -> 'a
Sourceval bind : ?overwrite_status:status -> ?error_status:status -> ('ok -> ('a, 'error) Result.result) -> ('ok, 'error) t -> ('a, 'error) t
Sourceval map : ('ok -> 'a) -> ('ok, 'error) t -> ('a, 'error) t
Sourceval map2 : ('a -> 'b -> 'ok) -> ('a, 'error) t -> ('b, 'error) t -> ('ok, 'error) t
Sourceval error : ?status:status -> 'error -> ('ok, 'error) t
Sourceval ok : ?status:status -> 'ok -> ('ok, 'error) t
OCaml

Innovation. Community. Security.