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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id D25DA7EC6E for ; Fri, 17 Jan 2014 12:23:34 +0100 (CET) X-IronPort-AV: E=Sophos;i="4.95,670,1384297200"; d="scan'208";a="53693269" Received: from sympa.inria.fr ([193.51.193.213]) by mail2-relais-roc.national.inria.fr with ESMTP; 17 Jan 2014 12:23:34 +0100 Received: by sympa.inria.fr (Postfix, from userid 20132) id C5D927F706; Fri, 17 Jan 2014 12:23:34 +0100 (CET) Date: Fri, 17 Jan 2014 12:23:32 +0100 To: caml-list@inria.fr In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7BIT From: "Jonathan Kimmitt" X-Mailer: Sympa 6.1.17 Subject: Re: [Caml-list] How much optimized is the 'a option type ? In my humble opinion the main purpose of Some _ | None is to avoid the requirement for a nil pointer in OCaml. If an external function wants to return nil in order to indicate, for example that a certain resource is not available, it can return None instead and this prevents dereferencing a nil pointer in OCaml because the None cannot be dereferenced. If you compare this behaviour with the inferior clone F# written by Microsoft, you can see that one of the things they added to the language was a nil pointer, thus abandoning all type safety immediately and all because they did not want to change their .NET runtime system for C# etc. They also have the notion of initialising a typed object to in an invalid default, which is another obvious disaster area. Oh and did I mention operators like +/- etc are overloaded so you cannot infer function types without adding type annotations. The final insult is to make indentation significant in the syntax so that if you post a program to a list which does not respect whitespace (for example using a well-known Microsoft mail client), it completely destroys the meaning of the program. I'm sure the authors of F# have their reasons for making all these changes, and I'm not one to stand in the way of progress, and I don't set out to offend anybody, but I think they got it wrong ...