From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 4981C7F75D for ; Thu, 30 Jan 2014 22:31:24 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of jon@ffconsultancy.com) identity=pra; client-ip=212.159.14.17; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="jon@ffconsultancy.com"; x-sender="jon@ffconsultancy.com"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of jon@ffconsultancy.com) identity=mailfrom; client-ip=212.159.14.17; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="jon@ffconsultancy.com"; x-sender="jon@ffconsultancy.com"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@avasout02.plus.net) identity=helo; client-ip=212.159.14.17; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="jon@ffconsultancy.com"; x-sender="postmaster@avasout02.plus.net"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqABAF7D6lLUnw4RnGdsb2JhbABZrnSSRAqBDBYOAQEBAQEGDQkJFCiCJQEBAQQIAjA/DQMCCRguGSMbAgQeBYd5zG0XjwIHhDgEjymeSw X-IPAS-Result: AqABAF7D6lLUnw4RnGdsb2JhbABZrnSSRAqBDBYOAQEBAQEGDQkJFCiCJQEBAQQIAjA/DQMCCRguGSMbAgQeBYd5zG0XjwIHhDgEjymeSw X-IronPort-AV: E=Sophos;i="4.95,752,1384297200"; d="scan'208";a="47191882" Received: from avasout02.plus.net ([212.159.14.17]) by mail3-smtp-sop.national.inria.fr with ESMTP; 30 Jan 2014 22:31:23 +0100 Received: from XPS ([46.208.209.80]) by avasout02 with smtp id LMXM1n0031kdSZJ01MXNLF; Thu, 30 Jan 2014 21:31:22 +0000 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=KvrD2AmN c=1 sm=1 tr=0 a=0e+StC6m1dZv7qXQ+YhjwA==:117 a=0e+StC6m1dZv7qXQ+YhjwA==:17 a=0Bzu9jTXAAAA:8 a=XCxr5DcLagoA:10 a=Xub9RBUEA-sA:10 a=Kvk-SOs2Z7YA:10 a=kj9zAlcOel0A:10 a=r2vSxAw-AAAA:8 a=BR64nyZ84HQA:10 a=crhGuMA_VlWhoMKCocEA:9 a=CjuIK1q_8ugA:10 X-AUTH: jdh302:2500 Reply-To: From: "Jon Harrop" To: "'Yotam Barnoy'" Cc: "'Goswin von Brederlow'" , "'Ocaml Mailing List'" References: <20140120101654.GI26447@frosties> <08bc01cf17b8$9263d070$b72b7150$@ffconsultancy.com> <20140123092925.GB20624@frosties> <01c401cf1891$b1fb1360$15f13a20$@ffconsultancy.com> <026101cf18dd$756c13d0$60443b70$@ffconsultancy.com> <030501cf1925$45380fa0$cfa82ee0$@ffconsultancy.com> <20140127152944.GA29326@frosties> <02c001cf1ccc$b635a9b0$22a0fd10$@ffconsultancy.com> In-Reply-To: Date: Thu, 30 Jan 2014 21:31:27 -0000 Organization: Flying Frog Consultancy Ltd. Message-ID: <04ca01cf1e02$a2dc7b00$e8957100$@ffconsultancy.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQHI4li4v5YdVc3QG7JLKEaISEVTZQITm23GAs0uvsEBcUwfGALv8TtSARGMS8wBZ0wNRgGSGZD1Aq5lN6wCA46uAwIAfLE+Ai7euecCTHJxcQGMOt68mdoIHwA= Content-Language: en-gb Subject: RE: [Caml-list] How much optimized is the 'a option type ? Yotam wrote: > I don't think so. Without metadata, how do you know where one tuple member ends and another begins? Use static type information. When the type is known to be 'a * 'b you use the unboxed representation. Otherwise you default to the boxed representation. OCaml already does this to some extent because functions that accept a tuple are compiled to multi-argument functions (IIRC). So this would just be an extension to handle the return value too. The same idea could be used with many other types, e.g. unboxed optional arguments. Cheers, Jon.