Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
(int * int) <> int*int ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Frédéric_Gava <gava@u...>
Subject: Re: [Caml-list] (int * int) <> int*int ?
> # type t=A of int*int and  t'= B of (int*int);;
> type t = A of int * int
> and t' = B of (int * int)
> See section 18.3.4 of the manual -- the distinction allows the runtime
> representation of t to avoid a level of indirection.

Thanks for your anwser but I am not convinced that is a good reason. If "t"
is better why " t' " is not automatically tranform into "t" (it is easy, you
just delete the global parens). ok (int->int)->int <> int->int->int or
int*int*int<>int*(int*int) . Morever I think that int*int=(int*int)
"everywhere" in ML...
# type t=int*int;;
type t = int * int
# type t'=(int*int);;
type t' = int * int

>And since the runtime representations are different, the types have to be
Wrong, you can the same representation but different types (e.g. int, char
or many other examples)