jon.recoil.org

Module Ocamlformat_stdlib.ErrorSource

include Ppx_compare_lib.Comparable.S with type t := t
include Ppx_compare_lib.Equal.S with type t := t
include Ppx_compare_lib.Equal.S__local with type t := t
include Ppx_hash_lib.Hashable.S with type t := t
include Sexplib0.Sexpable.S__stack with type t := t
include Sexplib0.Sexpable.Of_sexp with type t := t
include Sexplib0.Sexpable.Sexp_of__stack with type t := t

Be careful that the body of the lazy or thunk does not access mutable data, since it will only be called at an undetermined later point.

Sourceval raise : ('a : value_or_null). t -> 'a @ portable @@ portable

Note that the exception raised by this function maintains a reference to the t passed in.

Sourceval raise_s : ('a : value_or_null). Sexplib0.Sexp.t -> 'a @ portable @@ portable
Sourceval reraise_uncaught : t -> f:(unit -> 'a) @ local once -> 'a @@ portable

Re-raise exceptions raised from f with this t as context. If this function raises, the exception maintains a reference to the t passed in.

Sourceval to_info : t -> Base__.Info0.t @@ portable
Sourceval of_info : Base__.Info0.t -> t @@ portable
include Ppx_compare_lib.Comparable.S with type t := t
Sourceval compare : t -> t -> int
include Ppx_compare_lib.Equal.S with type t := t
Sourceval equal : t -> t -> bool
include Ppx_compare_lib.Equal.S__local with type t := t
Sourceval globalize : t @ local -> t
include Sexplib0.Sexpable.S__stack with type t := t
include Sexplib0.Sexpable.Of_sexp with type t := t
include Sexplib0.Sexpable.Sexp_of__stack with type t := t
Sourceval sexp_of_t : t -> Sexplib0.Sexp.t
Sourceval t_sexp_grammar : t Sexplib0.Sexp_grammar.t @@ portable
Sourceval t_of_sexp : Sexplib0.Sexp.t -> t @ portable @@ portable

Explicitly indicate that t_of_sexp produces a portable t. This is nicer for the user: you can do more things with a portable t, e.g. move it between domains.

Sourceval invariant : t -> unit
Sourceval to_string_hum : t -> string @@ portable

to_string_hum forces the lazy message, which might be an expensive operation.

to_string_hum usually produces a sexp; however, it is guaranteed that to_string_hum (of_string s) = s.

If this string is going to go into a log file, you may find it useful to ensure that the string is only one line long. To do this, use to_string_mach t.

Sourceval to_string_mach : t -> string @@ portable

to_string_mach t outputs t as a sexp on a single line.

Sourceval of_string : string -> t @ portable @@ portable

Be careful that the body of the lazy or thunk does not access mutable data, since it will only be called at an undetermined later point.

Sourceval of_lazy : string Base.Lazy.t -> t @@ portable
Sourceval of_lazy_sexp : Sexplib0.Sexp.t Base.Lazy.t -> t @@ portable
Sourceval of_lazy_t : t Base.Lazy.t -> t @@ portable
Sourceval of_thunk : (unit -> string) -> t @@ portable
Sourceval of_portable_lazy : string Base.Portable_lazy.t -> t @ portable @@ portable
Sourceval of_portable_lazy_sexp : Sexplib0.Sexp.t Base.Portable_lazy.t -> t @ portable @@ portable
Sourceval of_portable_lazy_t : t Base.Portable_lazy.t -> t @ portable @@ portable
Sourceval create : ('a : value_or_null). ?here:Lexing.position -> ?strict:unit -> string -> 'a -> ('a -> Sexplib0.Sexp.t) -> t @@ portable

For create message a sexp_of_a, sexp_of_a a is lazily computed, when the info is converted to a sexp. So if a is mutated in the time between the call to create and the sexp conversion, those mutations will be reflected in the sexp. Use ~strict:() to force sexp_of_a a to be computed immediately.

Sourceval create_s : Sexplib0.Sexp.t -> t @ portable @@ portable
Sourceval createf : ('a, unit, string, t) format4 -> 'a @@ portable

Constructs a t containing only a string from a format. This eagerly constructs the string.

Sourceval createf_portable : ('a, unit, string, unit -> t @ portable) format4 -> 'a @@ portable

createf_portable format arg1 arg2 ... () is like createf format arg1 arg2 ..., except creating a portable error.

Sourceval tag : t -> tag:string -> t @@ portable

Adds a string to the front.

Sourceval tag_s : t -> tag:Sexplib0.Sexp.t -> t @@ portable

Adds a sexp to the front.

Sourceval tag_lazy : t -> tag:string Base.Lazy.t -> t @@ portable

Adds a lazy string to the front.

Sourceval tag_portable_lazy : t -> tag:string Base.Portable_lazy.t -> t @@ portable

Adds a portable lazy string to the front.

Sourceval tag_s_lazy : t -> tag:Sexplib0.Sexp.t Base.Lazy.t -> t @@ portable

Adds a lazy sexp to the front.

Sourceval tag_s_portable_lazy : t -> tag:Sexplib0.Sexp.t Base.Portable_lazy.t -> t @@ portable

Adds a portable lazy sexp to the front.

Sourceval tag_arg : ('a : value_or_null). t -> string -> 'a -> ('a -> Sexplib0.Sexp.t) -> t @@ portable

Adds a string and some other data in the form of an s-expression at the front.

Sourceval of_list : t list -> t @@ portable

Combines multiple infos into one.

Sourceval of_exn : ?backtrace:[ `Get | `This of string ] -> exn -> t @ portable @@ portable

of_exn and to_exn are primarily used with Error, but their definitions have to be here because they refer to the underlying representation.

~backtrace:`Get attaches the backtrace for the most recent exception. The same caveats as for Printexc.print_backtrace apply. ~backtrace:(`This s) attaches the backtrace s. The default is no backtrace.

Sourceval to_exn : t -> exn @@ portable
Sourceval pp : Base.Formatter.t -> t -> unit @@ portable
Sourcemodule Internal_repr : sig ... end
Sourcemodule Portable : sig ... end
Sourceval of_portable : Portable.t -> t @ portable @@ portable
Sourceval to_portable : t @ portable -> Portable.t @@ portable
Sourceval portabilize : t -> t @ portable @@ portable

Constructs a portable info out of a possibly non-portable info. This operation is less expensive than err |> sexp_of_t |> create_s, but it's not a no-op.

It's not a no-op because it needs to force any non-portable computation of the input info.

Sourceval to_portable_portabilize : t -> Portable.t @@ portable

Convert to Portable.t via portabilize.

Sourcemodule Utf8 : sig ... end

Unlike the standard to_string_* functions under S, these encode any t that's represented by a sexp 1 using Sexp.Utf8.to_string_*, ensuring that valid UTF-8 sexp atoms get printed as-is. Standard to_string_* functions, by contrast, encode sexps using Sexp.to_string_*, encoding UTF-8 / other non-ASCII characters using escape sequences.