From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id EF12CBC69 for ; Thu, 18 Oct 2007 18:22:39 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAALQkF0fLENaMnmdsb2JhbACOTQIBAQcEBhEY X-IronPort-AV: E=Sophos;i="4.21,296,1188770400"; d="scan'208";a="3246661" Received: from ipmail01.adl2.internode.on.net ([203.16.214.140]) by mail2-smtp-roc.national.inria.fr with ESMTP; 18 Oct 2007 18:22:38 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAGYkF0d5LCRsWmdsb2JhbAAMjjcBIA X-IronPort-AV: E=Sophos;i="4.21,296,1188743400"; d="scan'208";a="213560075" Received: from ppp121-44-36-108.lns10.syd7.internode.on.net (HELO [192.168.1.201]) ([121.44.36.108]) by ipmail01.adl2.internode.on.net with ESMTP; 19 Oct 2007 01:52:32 +0930 Subject: Re: [Caml-list] Smells like duck-typing From: skaller To: Brian Hurt Cc: Arnaud Spiwack , caml-list@yquem.inria.fr In-Reply-To: <471771A7.3010402@janestcapital.com> References: <377673.31302.qm@web54602.mail.re2.yahoo.com> <47176B4A.5000807@janestcapital.com> <47176DB6.7090700@lix.polytechnique.fr> <471771A7.3010402@janestcapital.com> Content-Type: text/plain Date: Fri, 19 Oct 2007 02:22:31 +1000 Message-Id: <1192724551.5999.37.camel@rosella.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.12.0 Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; ocaml's:01 polymorphism:01 subtype:01 subset:01 subset:01 sourceforge:01 imho:01 wrote:01 caml-list:01 generally:04 expose:04 thu:05 brian:05 projections:94 structure:07 On Thu, 2007-10-18 at 10:45 -0400, Brian Hurt wrote: > I will note that Ocaml's row-level polymorphism allows you to invent new > supertypes of a given subtype as needed (a real nice feature, IMHO). > But what he's asking for is fundamentally nonsensical. No it isn't, its just mis-stated. What he actually wants is projections, which are perfectly sound. That is, given a concrete record with N fields, a collection of *views* which only expose a subset of the fields. More generally, not just a subset of fields, but a new record which is the image of a epimorphism (a structure preserving surjection or 'onto' mapping). -- John Skaller Felix, successor to C++: http://felix.sf.net