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=1.0 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 934BEBBC1 for ; Thu, 6 Mar 2008 03:05:09 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAN/fzkfAXQInh2dsb2JhbACQeQEBAQgKKZM7hwg X-IronPort-AV: E=Sophos;i="4.25,454,1199660400"; d="scan'208";a="9929096" Received: from concorde.inria.fr ([192.93.2.39]) by mail3-smtp-sop.national.inria.fr with ESMTP; 06 Mar 2008 03:05:09 +0100 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m26258i1021444 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Thu, 6 Mar 2008 03:05:08 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAJLgzkfRVYT6lWdsb2JhbACQeQEBAQEHBAQJChYCkzuHCA X-IronPort-AV: E=Sophos;i="4.25,454,1199660400"; d="scan'208";a="23414152" Received: from an-out-0708.google.com ([209.85.132.250]) by mail4-smtp-sop.national.inria.fr with ESMTP; 06 Mar 2008 03:04:57 +0100 Received: by an-out-0708.google.com with SMTP id c24so379365ana.97 for ; Wed, 05 Mar 2008 18:04:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:reply-to:to:subject:date:user-agent:cc:references:in-reply-to:content-type:content-transfer-encoding:content-disposition:message-id; bh=2j7xJPlsz3f4B/Oq41RjhojhnbEKOM5neScwEVeql4s=; b=YsnSqUQkC0vW0w8OG3++WrAo3fboyTnX40GY9WjU+gSnO3qoE6FddMhQ6wR0jSeMcK4IjgwOYpLzQsFi+P3VdExa2XtP4XgnilBDlb4qh2U6x2yUEaZ8/GpejfvOdtmpV/7xEjksRDOdDLVZGO8yC9YcG5s4srwvJNZ46hA8LD8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:reply-to:to:subject:date:user-agent:cc:references:in-reply-to:content-type:content-transfer-encoding:content-disposition:message-id; b=hhRdFMxoCKUfYlMmsxar1H5y/2ExWqEyn+vBYeRFkQT9GmbTXlVRy3DXVKuiK+z4009HGsYeDA3+/3NBQCBedWOeH4TkxZti3KRrcPPq8GB6oJOcwja3SAle7F/KZu41DM5vx1h0gK/gaO1soRmNQ+bcrrly8/lqn6POFjW2v6U= Received: by 10.100.46.10 with SMTP id t10mr8715168ant.53.1204769095293; Wed, 05 Mar 2008 18:04:55 -0800 (PST) Received: from tama-chan ( [24.99.180.210]) by mx.google.com with ESMTPS id 33sm2602649wra.23.2008.03.05.18.04.53 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 05 Mar 2008 18:04:54 -0800 (PST) From: Peng Zang Reply-To: peng.zang@gmail.com To: Edgar Friendly Subject: Re: [Caml-list] specifying the type of an argument with more than one #classpath Date: Wed, 5 Mar 2008 21:04:48 -0500 User-Agent: KMail/1.9.7 Cc: caml-list@inria.fr References: <200803052052.10651.peng.zang@gmail.com> <47CF4F57.3060309@gmail.com> In-Reply-To: <47CF4F57.3060309@gmail.com> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200803052104.52266.peng.zang@gmail.com> X-Miltered: at concorde with ID 47CF5154.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; hash:01 foo:01 foo:01 iter:01 peng:98 peng:98 edgar:98 wrote:01 wrote:01 caml-list:01 lazy:02 lazy:02 argument:02 constraints:03 gnu:03 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 This works if #foo just implies one method "foo". But suppose it were more general, like: #drawable which implies methods draw2,drawfast,drawbuffered,etc.. and #foldable which implies methods iter,sample,map,to_list,etc... We would like to avoid calling every implied method. Thanks, Peng On Wednesday 05 March 2008 08:56:39 pm Edgar Friendly wrote: > Peng Zang wrote: > > Is there some simple trick people have found for specifying various type > > constraints on arguments? > > How about something like: > let takesomefooable_and_barable x = > ignore(lazy(x#foo)); > ignore(lazy(x#bar)); > x > > E -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) iD8DBQFHz1FEfIRcEFL/JewRAnlgAJ9kD4/itxfOvyl+IPIIaYojssHG+wCcDXIg 1CkxusK3dP96MHBS1PBe67k= =2X1k -----END PGP SIGNATURE-----