clean code
This commit is contained in:
parent
97864116bb
commit
20f18bcd76
24 changed files with 99 additions and 894 deletions
|
|
@ -3,10 +3,4 @@
|
|||
|
||||
let ( let* ) o f = Result.fold ~ok:f ~error:Result.error o
|
||||
|
||||
let unwrap_list f ids =
|
||||
let l = List.map f ids in
|
||||
let res = List.find_opt Result.is_error l in
|
||||
match res with
|
||||
| None -> Ok (List.map Result.get_ok l)
|
||||
| Some (Ok _) -> assert false
|
||||
| Some (Error _e as error) -> error
|
||||
let ( let** ) o f = match o with Error e -> Template.err e | Ok v -> f v
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue