Browse thread
(int * int) <> int*int ?
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2006-02-23 (19:20) |
From: | Frédéric_Gava <gava@u...> |
Subject: | Re: [Caml-list] (int * int) <> int*int ? |
> Because tuples are generally immutable, there is little semantic > difference, but the compiler does have to keep track of which is which. Thanks, but which differnce ? >In most cases I would guess that 'A' would be more efficient (unless there are > lots of larger constructors sharing the same tuple). Peraps in patter mathching: # type t = A of int*int | B of (int*int);; type t = A of int * int | B of (int * int) # fun x -> match x with A (a,b) -> (a,b) | B a -> a;; - : t -> int * int = <fun> where the case of B will be more efficient since the are not need to rebuild a pair Best, FG