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 ?
< For performance issues, is there a way to not have the rebuild
> of the pair in
> # type t = A of int*int | B of (int*int);;
> # fun x -> match x with A (a,b) -> (a,b) | B a -> a;;
>
> ?
Peraps this idea:
if (all the time) A of (int*int) ==> A of int*int then in pattern mathching
"A a" the "a" is directly built as a tuple from the tuple of the concrete
type (just a little modification of the tag). Is it not a good idea ;-) ?

Best,
FG