On 11/09/2011 10:41 AM, Vincent Aravantinos wrote:
I actually wonder if they just *look* too complicated? Maybe because they are verbose? Each time you define a functor you also have to give the signature of its argument, which, compared to a simple "include" can look overkilling.
Concretely:

module A = struct
  ...
end

module B = struct
  include A
  ...
end

VS

module A = struct
  ...
end

module type B_INPUT = sig
  ... (can be big)
end

module Make_B (X:B_INPUT) = struct
  ...
end

This verbosity problem is actually less true since 3.12 with the introduction of "module type of":

module A = struct
  ...
end

module Make_B (X: module type of A) = struct
  ...
end

Which is then quite close to the "include" version.

--
Caml-list mailing list.  Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to