This repository has been archived on 2024-01-18. You can view files and clone it, but cannot push or open issues or pull requests.
compilation/flap/src/utilities/list.ml

10 lines
225 B
OCaml
Raw Normal View History

2023-10-04 15:40:22 +02:00
include Stdlib.List
let map_fold_right
: type a b c. (a -> b -> c * b) -> a list -> b -> c list * b =
fun f xs acc ->
fold_right
(fun x (ys, acc) -> let y, acc = f x acc in y :: ys, acc)
xs
([], acc)