Module Res

module Res: sig .. end
A result for some type.

type 'a res = 
| Ok of 'a (*
There was a problem.
*)
| Err of (Format.formatter -> unit)
val unwrap : 'a res -> 'a
Unwraps a result.
val map_res : ('a -> 'b) ->
((Format.formatter -> unit) -> Format.formatter -> unit) ->
'a res -> 'b res
Maps functions to Ok or Err.
val map : ('a -> 'b) -> 'a res -> 'b res
Maps a function to a result if it's Ok.
val map_err : ((Format.formatter -> unit) -> Format.formatter -> unit) ->
'a res -> 'a res
Maps a function to a result if it's Err.
val chain : ?fmt:((Format.formatter -> unit) -> Format.formatter -> unit) ->
('a -> 'b res) -> 'a res -> 'b res
Feeds a result to a function returning a result, propagates if argument's an error.
val l_fold : ?fmt:((Format.formatter -> unit) -> Format.formatter -> unit) ->
('acc -> 'a -> 'acc res) -> 'acc -> 'a list -> 'acc res
Fold over a list of results.
val l_map : ?fmt:((Format.formatter -> unit) -> Format.formatter -> unit) ->
('a -> 'b res) -> 'a list -> 'b list res
Map over a list with a result-producing function.
val l_iter : ?fmt:((Format.formatter -> unit) -> Format.formatter -> unit) ->
('a -> unit res) -> 'a list -> unit res
Iterate over a list with a result-producing function.