let result_tmp1 =
replace_all (create "dataUrl") ~in_:result ~with_:"\"dataUrl\""
in
let result_tmp2 =
replace_all (create "pages") ~in_:result_tmp1 ~with_:"\"pages\""
in
let result_final =
replace_all (create "data:") ~in_:result_tmp2 ~with_:"\"data\":"
in
or you could drop the label ~in_ entirely from the definition of replace_all. For this reason, even label-heavy libraries like those from Jane Street tend to avoid labelling at least one of the arguments to each function in order to support partial application.
Related aside: when a function application is saturated – i.e. it is known to not return a function – it’s possible to omit argument labels. Naturally this will never happen for pipe sequences, which rely on partial application on the RHS of the pipes. Even still, I recommend avoiding this language feature for the sake of consistency.