"David Allsopp" <dra-n...@metastack.com> writes: > Goswin von Brederlow wrote: > <snip> >> Then what about >> >> type t1 = Bar of int * int >> type t2 = Foo of (int * int) >> >> If you treat constructors as functions taking one argument then > > But why (so arbitrarily) do this?
Because that was what the mentioned material said. >> t1: int * int -> t1 >> t2: int * int -> t2 > > If you look at each type definition and choose those most appropriate, then: > > t1: int -> int -> t1 > t2: int * int -> t2 > > I don't see your point (but this is pre-coffee!)? The fact that you write > [Bar(1, 2)] for a two-constructor variant tag and [bar 1 2] for a "2 > argument" function is just an (occasionally irritating) oddity of the OCaml > syntax - it wouldn't have to affect any derived constructor functions here. Actualy you do see my point. My point was that the appropriate type should be used. > However, the impracticality of importing the types from other interfaces > (see Richard Jones post in this thread) has already revealed that this > couldn't be done transparently in the way I'd initially thought so it's > become a bit of a thought experiment anyway :o) > > > David MfG Goswin _______________________________________________ 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