Version française
Home     About     Download     Resources     Contact us    
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
different.
Wrong, you can the same representation but different types (e.g. int, char
or many other examples)

Best,
FG