From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA05762 for caml-redistribution; Tue, 12 Oct 1999 15:39:37 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id VAA27485 for ; Mon, 11 Oct 1999 21:23:53 +0200 (MET DST) Received: from isil.maya.com (isil.maya.com [192.70.254.5]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id VAA27646; Mon, 11 Oct 1999 21:23:51 +0200 (MET DST) Received: (from prevost@localhost) by isil.maya.com (8.9.3/8.9.3) id PAA03490; Mon, 11 Oct 1999 15:30:03 -0400 Sender: weis To: chet@watson.ibm.com Cc: William Chesters , caml-list@inria.fr, Pierre.Weis@inria.fr Subject: Re: Proposal for study: Add a categorical Initial type to ocaml References: <199910102238.SAA17988@bismarck.chet.org> From: John Prevost Date: 11 Oct 1999 15:30:03 -0400 In-Reply-To: chet@watson.ibm.com's message of "Sun, 10 Oct 1999 18:38:44 -0400" Message-ID: User-Agent: Gnus/5.070096 (Pterodactyl Gnus v0.96) Emacs/20.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii chet@watson.ibm.com writes: > Of course, it is problematic that "None" and "Some None" are > indistinguishable. But is it a reason to not have such a facility (as > a storage-cost-free "option" type constructor)? > > I'd like to believe that the answer is "no" -- that the efficiency > values of such a type-constructor outweigh the semantic difficulties. > > Of course, there's only one way to prove that -- by implementing both > and trying it out on large programs. One might presume that the definition that "'a nullOption === 'a nullOption nullOption" isn't too hard to understand (although it might muck up the inference engine.) (Some (Some x)) would be the same as (Some x) in this model, just as None would be the same as Some None. Probably not suitable for a replacement of the option type, but a useful additional type? John.