Error_monad: make filter_map_p truly parallel
This commit is contained in:
parent
18f6dab856
commit
52dc0c5858
@ -426,12 +426,12 @@ module Make(Prefix : sig val id : string end) = struct
|
|||||||
filter_map_s f t >>=? fun rt ->
|
filter_map_s f t >>=? fun rt ->
|
||||||
return (rh :: rt)
|
return (rh :: rt)
|
||||||
|
|
||||||
let filter_map_p f l =
|
let rec filter_map_p f l =
|
||||||
match l with
|
match l with
|
||||||
| [] -> return []
|
| [] -> return []
|
||||||
| h :: t ->
|
| h :: t ->
|
||||||
let th = f h
|
let th = f h
|
||||||
and tt = filter_map_s f t in
|
and tt = filter_map_p f t in
|
||||||
th >>=? function
|
th >>=? function
|
||||||
| None -> tt
|
| None -> tt
|
||||||
| Some rh ->
|
| Some rh ->
|
||||||
|
Loading…
Reference in New Issue
Block a user