11158Re: "ocaml_beginners":: Module parameterization by ints
- Jul 1 12:48 AMIt seems to me that this is exactly the same?
define a functor MyFunctor like this:
module MyFunctor (S : sig val sz : int end) =
... S.sz ... ← in your module, you now have
access to S.sz
Your module can now be generated like this:
module MyModule = MyFunctor (struct let sz = 3 end);;
Hoping this helps?
- << Previous post in topic Next post in topic >>