clean code

This commit is contained in:
zapashcanon 2022-12-06 00:12:14 +01:00
parent 97864116bb
commit 20f18bcd76
No known key found for this signature in database
GPG key ID: 8981C3C62D1D28F1
24 changed files with 99 additions and 894 deletions

View file

@ -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