Hi,

Similarly to polymorphic variants, is there a way for object signatures to
be merged by type name?  Consider the example at the end; I'm wondering if
it is possible for the declaration of 'foobar' to be something along the
lines of 'val foobar: int -> int -> < foo_t; bar_t >' instead of needing to
explicitly list all the methods in foo_t and bar_t.

Thanks in advance for your help!
Best regards,
Dario Teixeira


module Test:
sig
        type foo_t = < a: int >
        type bar_t = < b: int >

        val foobar: int -> int -> < a:int; b: int >

        (* val foobar: int -> int -> < foo_t; bar_t > *)
end =
struct
        type foo_t = < a: int >
        type bar_t = < b: int >

        class foo a = object method a: int = a end
        class bar b = object method b: int = b end

        let foobar a b =
        object
                inherit foo a
                inherit bar b
        end
end





_______________________________________________
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