I don't know how you might directly get what you want, but here's one way to get an equivalent result.

class element_aux (c : [`Data of string | `Element of element list]) = object end

type content = Data of string | Element of element list;;

let content_of_variant = function Data d -> `Data d | Element e -> `Element e

class element (c : content) = element_aux (content_of_variant c)

_______________________________________________
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