Hi,  I don’t think it is possible.  Suppose you can use only one type constructor. What should be the type of function “fun a b -> Foo (a, b)”? Kindly, Runhang On Fri, Jul 31, 2015 at 3:18 PM, Ashish Agarwal wrote: > You essentially still have 2 constructors, so this isn't quite what I'm > aiming for. > On Fri, Jul 31, 2015 at 9:57 AM, Carl Eastlund > wrote: >> Perhaps like this? (Caveat: I typed this straight into gmail, I haven't >> tried to compile or run this code at all.) >> >> type ('a, 'b, 'c) tag = >> | Tag1 : ('a, int, int) tag >> | Tag2 : ('a, string, 'a) tag >> >> type 'a t = >> | Foo : ('a, 'b, 'c) tag * 'a * 'b -> 'c t >> >> On Fri, Jul 31, 2015 at 9:48 AM, Ashish Agarwal >> wrote: >> >>> I have: >>> >>> type _ t = >>> | Foo1 : 'a * int -> int t >>> | Foo2 : 'a * string -> 'a t >>> >>> but I really want to merge these two cases. I want the return type to be >>> based on the second arg when the second arg is int, and be based on the >>> first arg otherwise. Any way to accomplish that? >>> >>> >> >> >> -- >> Carl Eastlund >> > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs