module Foo (Env : Env_types.S) = struct
let quickcheck_generator = (* ... *)
(* ... *)
end
let gen_foo env =
let module F = Foo (struct let env = env end) in quickcheck_generator
This is unnecessarily inducing a lot of module boilerplate we don't need, because we could rewrite to:
let gen_foo (env : Env.t) = (* ... *)
module Foo (Env : Env_types.S) = struct
let quickcheck_generator = gen_foo Env.env
(* ... *)
end
A common pattern in the codebase these days is:
This is unnecessarily inducing a lot of module boilerplate we don't need, because we could rewrite to: