From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 737157F6C4 for ; Thu, 23 Jan 2014 10:29:27 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of goswin-v-b@web.de) identity=pra; client-ip=212.227.17.11; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="goswin-v-b@web.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of goswin-v-b@web.de) identity=mailfrom; client-ip=212.227.17.11; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="goswin-v-b@web.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mout.web.de) identity=helo; client-ip=212.227.17.11; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="postmaster@mout.web.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvcBAPff4FLU4xELnGdsb2JhbABbuj2FUIEPFg4BAQEBAQYNCQkUKIIlAQEBBDpPCxgJJQ8FKIgkARi+dx+GDhePAxaDDoEUBJghhjESjwQ X-IPAS-Result: AvcBAPff4FLU4xELnGdsb2JhbABbuj2FUIEPFg4BAQEBAQYNCQkUKIIlAQEBBDpPCxgJJQ8FKIgkARi+dx+GDhePAxaDDoEUBJghhjESjwQ X-IronPort-AV: E=Sophos;i="4.95,705,1384297200"; d="scan'208";a="54482698" Received: from mout.web.de ([212.227.17.11]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 23 Jan 2014 10:29:27 +0100 Received: from frosties.localnet ([37.49.32.119]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0Lpf3q-1Vd0Jn4170-00fVdg for ; Thu, 23 Jan 2014 10:29:26 +0100 Received: from mrvn by frosties.localnet with local (Exim 4.80) (envelope-from ) id 1W6GbF-0005ZA-AM for caml-list@inria.fr; Thu, 23 Jan 2014 10:29:25 +0100 Date: Thu, 23 Jan 2014 10:29:25 +0100 From: Goswin von Brederlow To: caml-list@inria.fr Message-ID: <20140123092925.GB20624@frosties> References: <20140120101654.GI26447@frosties> <08bc01cf17b8$9263d070$b72b7150$@ffconsultancy.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <08bc01cf17b8$9263d070$b72b7150$@ffconsultancy.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Provags-ID: V03:K0:bHOGbkwyri1Ws0MTyezr2wvi2PJ47mNpPbQHNGukWE93dS8kxxn Tzhu4z+TIGnn9Zlyq1widCA/PxVf8eRBlvX6WC4eZ2IGXjFd3WufqpcijpiYiP+ImI3opOQ fhroirXyMGTHYRWoUkrIWzneLU1CacU6U2O8zj6zv5PTJ6KDN14Oz0/k4QNmC5ueCW1H4fN 29vWcwLUaFFagLQi+lzSw== Subject: Re: [Caml-list] How much optimized is the 'a option type ? On Wed, Jan 22, 2014 at 09:26:09PM -0000, Jon Harrop wrote: > Goswin wrote: > > In F#, with nil pointer, that will be a problem. But I guess nobody ever > has 'a option option types there > > I believe the representation of Some None in F# is a heap allocated block > containing a NULL pointer. > > Cheers, > Jon. So Some x is the value x unless x is an option type? That wouldn't work for polymorphic functions, those taking 'a option. You can't encode 'a option differently depending on 'a unless you have a flag for which encoding it used as well. I think you can only have one: option types using nil or 'a option option. Which doesn't mean you can't have nil too, just not to represent the None part of 'a option. In ocaml you would need a new type syntax like type 'a ptr_option = NIL | PTR of 'a constraint type b . 'a != b ptr_option MfG Goswin