mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-08 04:05:30 -05:00
use result package for retrocompat
This commit is contained in:
parent
e9de0a8902
commit
7e8c7235bc
1 changed files with 6 additions and 6 deletions
|
|
@ -148,16 +148,16 @@ let of_list = function
|
||||||
| [] -> None
|
| [] -> None
|
||||||
|
|
||||||
let to_result err = function
|
let to_result err = function
|
||||||
| None -> Error err
|
| None -> Result.Error err
|
||||||
| Some x -> Ok x
|
| Some x -> Result.Ok x
|
||||||
|
|
||||||
let to_result_lazy err_fn = function
|
let to_result_lazy err_fn = function
|
||||||
| None -> Error (err_fn ())
|
| None -> Result.Error (err_fn ())
|
||||||
| Some x -> Ok x
|
| Some x -> Result.Ok x
|
||||||
|
|
||||||
let of_result = function
|
let of_result = function
|
||||||
| Error _ -> None
|
| Result.Error _ -> None
|
||||||
| Ok x -> Some x
|
| Result.Ok x -> Some x
|
||||||
|
|
||||||
module Infix = struct
|
module Infix = struct
|
||||||
let (>|=) = (>|=)
|
let (>|=) = (>|=)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue