add data_file.ml
This commit is contained in:
parent
760e6de1fb
commit
bc91f7357c
8 changed files with 207 additions and 101 deletions
|
|
@ -38,3 +38,11 @@ let list_fold_left f acc l =
|
|||
let* acc = acc in
|
||||
f acc v)
|
||||
(Ok acc) l
|
||||
|
||||
let opt_list l =
|
||||
match (List.for_all Option.is_none l, List.for_all Option.is_some l) with
|
||||
| _, true ->
|
||||
let l = List.map Option.get l in
|
||||
Ok (Some l)
|
||||
| true, _ -> Ok None
|
||||
| _, _ -> Error ()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue