write List.flat_map
This commit is contained in:
parent
2ecef57faa
commit
eec24d1602
|
@ -16,4 +16,15 @@ module Result_syntax = struct
|
|||
let ( let+ ) r f = Result.map f r
|
||||
end
|
||||
|
||||
module List = struct
|
||||
include List
|
||||
|
||||
let flat_map f xs =
|
||||
let rec iter acc = function
|
||||
| [] -> rev acc
|
||||
| x :: xs -> iter (rev_append (f x) acc) xs
|
||||
in
|
||||
iter [] xs
|
||||
end
|
||||
|
||||
include (val Logging.logs "Irc")
|
||||
|
|
Loading…
Reference in New Issue