On Fri, 12 Feb 2010 19:54:50 +0000
Jon Harrop <j...@ffconsultancy.com> wrote:

> 
> IIRC, there is an OCaml macro that will autogenerate the code to print values 
> of a variant type from the type definition. Does it handle polymorphic 
> variants?

Yes, but one needs to write out the type (as in the case with the closed 
variants) :

type t = [ `A of t | `B ] deriving (Show)
print_endline (Show.show<t>(`A `B))

-- 
 ygrek
 http://ygrek.org.ua

_______________________________________________
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