From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p2UCdRcR015574 for ; Wed, 30 Mar 2011 14:39:27 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AosFAFcjk03UTWUIkGdsb2JhbACERoJZkTGNABQBAQEBCQkNBxQEIaxBgl4BjjwFgSeDTHeQUw X-IronPort-AV: E=Sophos;i="4.63,268,1299452400"; d="scan'208";a="95388868" Received: from mx4.wp.pl ([212.77.101.8]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 30 Mar 2011 14:39:21 +0200 Received: (wp-smtpd smtp.wp.pl 9744 invoked from network); 30 Mar 2011 14:39:18 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=1024a; t=1301488758; bh=7cxVDBmXRSi1spPGvH1ni3I7yqG6Nz2kPOTllKtgwHk=; h=From:To:Subject; b=Dnl+IhZ9gXmkQcITDxUtcju7m85qX3zGzDmRZG/4rIAZZwYV6rk9lmlKP/K0TnhwD yMlOrBAo1f12mw8JlKQlgDEBUOv1ElZBVAsDBD4HlQdpFwteImObPUwk/BtqyAE6iO uQGIoTCpJcpF6p/j3kmJ9m/IjUp0o6gYehhatfWI= Received: from pfpleia.if.uj.edu.pl (HELO [149.156.90.26]) (d0@[149.156.90.26]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with AES256-SHA encrypted SMTP for ; 30 Mar 2011 14:39:18 +0200 Message-ID: <4D932456.4000803@wp.pl> Date: Wed, 30 Mar 2011 14:38:46 +0200 From: Dawid Toton User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 MIME-Version: 1.0 To: caml-list@yquem.inria.fr References: <74205EDF-69A3-479A-9214-52D2AB849558@gmail.com> <13A708B2-732E-4D51-A740-BCFDC4E0212F@gmail.com> In-Reply-To: <13A708B2-732E-4D51-A740-BCFDC4E0212F@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-WP-AV: skaner antywirusowy poczty Wirtualnej Polski S. A. X-WP-SPAM: NO 0000000 [ccOU] Subject: [Caml-list] Re: function that works on different record types, assuming they have a given field On 03/28/2011 08:35 PM, Joel Reymont wrote: > On Mar 28, 2011, at 7:34 PM, David Rajchenbach-Teller wrote: > >> you can obtain the same behavior by using objects instead of records: > Yes, that used to work very well... until I was forced to switch to records :-). > When I had this problem I used one common record type: type ('foo, 'bar') common = {foo : 'foo ;bar : 'bar ;x : int } type with_bar = (unit, string) common type with_foo = (double, unit) common However, I can see that with more different independent types this is going to be quite ugly. Dawid