diff --git a/cohttp-eio/src/header.ml b/cohttp-eio/src/header.ml index 4916181d0..de1218a20 100644 --- a/cohttp-eio/src/header.ml +++ b/cohttp-eio/src/header.ml @@ -221,7 +221,7 @@ let make_header_t : #header_definition -> 'a header_t = type v = V : 'a header * 'a Lazy.t -> v (* Header values are stored lazily. *) type binding = B : 'a header * 'a -> binding -type mapper = { f : 'a. 'a header -> 'a -> 'a } +type mapper = < f : 'a. 'a header -> 'a -> 'a > module M = Map.Make (String) @@ -265,13 +265,13 @@ let find_opt k t = let iter f t = M.iter (fun _key v -> match v with V (k, v) -> f @@ B (k, Lazy.force v)) t.m -let map mapper t = +let map (m : mapper) t = let m = M.map (fun v -> match v with | V (k, v) -> - let v = mapper.f k @@ Lazy.force v in + let v = m#f k @@ Lazy.force v in V (k, lazy v)) t.m in