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: 2006-02-23 (21:32)
From: Frédéric_Gava <gava@u...>
Subject: Re: [Caml-list] (int * int) <> int*int ?
>Only historical reasons, AFAIK. I do not believe this is necessary or that
>there is a logical reason for doing so.
Peraps. I do not know. Peraps also to keep safe old programs...

>I also believe that statement was wrong but I don't think you have provided
>counter-examples because the run-time representations are the same for the
>different types that you cite (rather than the converse).

I just want to say that in or char have the same representation but
different types (contraposition)

>Also, note that this behaviour does not appear with polymorphic variants,
>where int * int <=> (int * int):

># type t = A of int * int | B of (int * int);;
>type t = A of int * int | B of (int * int)
># type t = [ `A of int * int | `B of (int * int) ];;
>type t = [ `A of int * int | `B of int * int ]

>I assume the arguments of a polymorphic variant are always boxed...

This is why you could not have more than 255 constructor in concrete
variants and many more in polymorphic ones.