I wasn’t even aware that this can be an issue - when debugging I’ve always added the externally visible types 'a, 'b
and etc.
for completeness adding:
and OCaml - Language extensions
which supports both function syntaxes
let rec aux : type a b. a list -> f:(a -> b) -> acc:b list -> b list =
fun xs ~f ~acc ->
match xs with [] -> acc | x :: xs -> aux xs ~f ~acc:(f x :: acc)
let rec aux2 (type a b) (xs : a list) ~(f : a -> b) ~(acc : b list) : b list =
match xs with [] -> acc | x :: xs -> aux xs ~f ~acc:(f x :: acc)