package ocaml-protoc-plugin

  1. Overview
  2. Docs

This module provides result type and functions for compatibility * with OCaml 4.06

type error = [
  1. | `Premature_end_of_input
  2. | `Unknown_field_type of int
  3. | `Wrong_field_type of string * Ocaml_protoc_plugin__.Field.t
  4. | `Illegal_value of string * Ocaml_protoc_plugin__.Field.t
  5. | `Unknown_enum_value of int
  6. | `Oneof_missing
  7. | `Required_field_missing
]
type 'a t = ('a, error) Stdlib.result
val (>>|) : ('a, 'b) Stdlib.result -> ('c -> 'd) -> ('e, 'f) Stdlib.result
val (>>=) : ('a, 'b) Stdlib.result -> ('c -> ('d, 'e) Stdlib.result) -> ('d, 'e) Stdlib.result
val open_error : ('a, [< error ]) Stdlib.result -> ('b, [> `Illegal_value of string * Ocaml_protoc_plugin__.Field.t | `Oneof_missing | `Premature_end_of_input | `Required_field_missing | `Unknown_enum_value of int | `Unknown_field_type of int | `Wrong_field_type of string * Ocaml_protoc_plugin__.Field.t ]) Stdlib.result
val return : 'a -> ('b, 'c) Stdlib.result
val fail : 'a -> ('b, 'c) Stdlib.result
val get : msg:string -> ('a, 'b) Stdlib.result -> 'c
val pp_error : Stdlib.Format.formatter -> error -> unit
val show_error : error -> string
val pp : (Stdlib.Format.formatter -> 'a -> unit) -> Stdlib.Format.formatter -> ('b, [< error ]) Stdlib.result -> unit