Hi,

Le 26 avr. 10 à 18:33, Dawid Toton a écrit :

I've found that I have more fundamental problem. What is the exact meaning of the following line?

module type Foo = functor (X:X) -> sig val foo : X.t end

(1) Foo is not a functor, but it is a type of some functors that map modules to modules
(2) Foo is a mapping from modules to module types

Currently I think that it (1) is true and (2) is false. Let me know if I'm wrong.

You're right.

It means that there is no easy way to get module type of what results from functor application. I think that the solution is to separately define signature of results of the functor and use "with type" clauses to recreate all result module types that are needed.

That's exactly the way to go (BTW is it such a pain? maybe your "with type" is easily inferred but not easily written?)

This is not very bad, but I'm still wondering if "module type of..." of 3.12 will provide elegant solution for this.

I can't remember this point...

V.
_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to