From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA14013 for caml-redistribution; Fri, 16 Oct 1998 13:32:33 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA17534 for ; Thu, 15 Oct 1998 19:26:45 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.8.7/8.8.7) with ESMTP id TAA25386; Thu, 15 Oct 1998 19:25:27 +0200 (MET DST) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA17530; Thu, 15 Oct 1998 19:25:27 +0200 (MET DST) Message-ID: <19981015192527.04035@pauillac.inria.fr> Date: Thu, 15 Oct 1998 19:25:27 +0200 From: Xavier Leroy To: Don Syme , caml-list@inria.fr Subject: Re: Boxing wrt. unary constructors References: <39ADCF833E74D111A2D700805F1951EF0B2EF53D@RED-MSG-06> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89.1 In-Reply-To: <39ADCF833E74D111A2D700805F1951EF0B2EF53D@RED-MSG-06>; from Don Syme on Wed, Oct 14, 1998 at 02:43:31AM -0700 Sender: weis > This is probably a FAQ, but if I have a type > type abc = ABC of int > then does Ocaml 2.00 use a boxed or unboxed repr. of values of this > type? Boxed. While it would not be hard to make a special case for one-constructor datatypes, this is not currently done in the OCaml compiler. However, you can use type abstraction to obtain much of the same effects while keeping an unboxed representation: (struct type abc = int let abc x = x let proj_abs x = x end : sig type abc val abc: int->abc val proj_abc: abc->int end) Regards, - Xavier Leroy