From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 466F37FC56 for ; Tue, 29 Sep 2015 16:52:31 +0200 (CEST) IronPort-PHdr: 9a23:NpTIqBxKJ6Uim4rXCy+O+j09IxM/srCxBDY+r6Qd0eMeIJqq85mqBkHD//Il1AaPBtWHra8bwLqM+4nbGkU+or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6anHS+4HYoFwnlMkItf6KuStKU0pv8h7r60qaQSjsLrQL1Wal1IhSyoFeZnegtqqwmFJwMzADUqGBDYeVcyDAgD1uSmxHh+pX4p8Y7oGx48sgs/M9YUKj8Y79wDfkBVGxnYCgJ45jJuALbQBHHwnwBU35euxxEDhLe4ReyCpX8qTP3rKx53zSbJov/S7w5Qy+v6Y9kTRbpjGEMMDtvo0/NjcklvatBpxTpgh152I3FKNWEMft4ZaDMVdETQ2daQtxcWjAHCYS5OdhcR9EdNPpV+tGu72AFqgGzUEz1XLvi Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=yminsky@janestreet.com; spf=Pass smtp.mailfrom=yminsky@janestreet.com; spf=None smtp.helo=postmaster@mxout1.mail.janestreet.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of yminsky@janestreet.com) identity=pra; client-ip=38.105.200.112; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yminsky@janestreet.com"; x-sender="yminsky@janestreet.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of yminsky@janestreet.com designates 38.105.200.112 as permitted sender) identity=mailfrom; client-ip=38.105.200.112; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yminsky@janestreet.com"; x-sender="yminsky@janestreet.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mxout1.mail.janestreet.com) identity=helo; client-ip=38.105.200.112; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yminsky@janestreet.com"; x-sender="postmaster@mxout1.mail.janestreet.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0DUAQBzpApWnHDIaSZeg3hpBoMkvESFeQKBRgc7EQEBAQEBAQEBEAEBAQEBBhYJT4IdgggBAQQSER0BATcBDwsLDQICJgICIQESAQUBHAYTIod3AxIDCqkugTA+MYpWcYRlAQWKWA2FCQEBAQEBAQEDAQEBAQEBAQEUAgQKgRiFUYR9glCCPQeCaYFDlXmFFoYNgXCTfIV8EiOBFzeCMAwdgXBVAYkeAQEB X-IPAS-Result: A0DUAQBzpApWnHDIaSZeg3hpBoMkvESFeQKBRgc7EQEBAQEBAQEBEAEBAQEBBhYJT4IdgggBAQQSER0BATcBDwsLDQICJgICIQESAQUBHAYTIod3AxIDCqkugTA+MYpWcYRlAQWKWA2FCQEBAQEBAQEDAQEBAQEBAQEUAgQKgRiFUYR9glCCPQeCaYFDlXmFFoYNgXCTfIV8EiOBFzeCMAwdgXBVAYkeAQEB X-IronPort-AV: E=Sophos;i="5.17,608,1437429600"; d="scan'208";a="148974877" Received: from mxout1.mail.janestreet.com ([38.105.200.112]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Sep 2015 16:52:30 +0200 Received: from tot-qpr-mailcore1.delacy.com ([172.27.56.68] helo=tot-qpr-mailcore1) by mxout1.mail.janestreet.com with esmtps (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.82) (envelope-from ) id 1ZgwGb-0000Dw-68 for caml-list@inria.fr; Tue, 29 Sep 2015 10:52:29 -0400 X-JS-Flow: external Received: by tot-qpr-mailcore1 with JS-mailcore (0.1) (envelope-from ) id BWCqWt-AAAEid-Ei; 2015-09-29 10:52:29.145866-04:00 Received: from mail-wi0-f182.google.com ([209.85.212.182]) by mxgoog1.mail.janestreet.com with esmtps (UNKNOWN:AES128-GCM-SHA256:128) (Exim 4.72) (envelope-from ) id 1ZgwGa-0006Rs-W7 for caml-list@inria.fr; Tue, 29 Sep 2015 10:52:29 -0400 Received: by wiclk2 with SMTP id lk2so155105591wic.0 for ; Tue, 29 Sep 2015 07:52:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=Je6v7VmXGIuhX+S+X7ZGKmGI9IpshBi7oEFYiI5tmGw=; b=C6r6A7c1VgoeVFjT1qouqcfzKMpVVNcWhKa4RcfzIfQG0ArRIt/T2aj1zkUkWHehCm 4irTqEf6CpQtjYVNSAQGf6LOSs1OPY7ZKRP3BxLGj6603Z6R3JtHNBVhGS0jBlSh70kB WbjwsrZ0jwVgNoPybYNuKVmuX0lPHhEf8hkn8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=Je6v7VmXGIuhX+S+X7ZGKmGI9IpshBi7oEFYiI5tmGw=; b=jCH5EynuUDGfLF32Ced4PrKbv9be/4DtaNkrsN4HNSvUWOhDBNfZgiiFJQKgU67bkX +nlpypLFjzMS+hKuUSQXs0TWiwIAVPpfMvRTxM7ZS1Z+lb4yX6paO5bzwMQ/IUYbUOSy emoxtIZXs89cmoT/OOf8FQfd/Smg6V2yYLgaObDdtMhDQ5TRmcJ9+VYBM00TEFv5TWCt 7b1oXV04p0hdTncqlO6SBkmvnq8xrEuSL4ZtVm6p7FuQccLQyrK0FsxlDNJ9bViZvgfj +v23f8tig0uH7YEiri2Dg8xE49vUJ+7ZwXN7+kWNesw/eztKNsAApbBIzg/65RfCj7Xf gE9A== X-Gm-Message-State: ALoCoQl8O5aAYmvdoTTHXBVGWoz7rh2VO8ILm70rMJZ0VnJ8yiDzOvBVYbOZi4V2tNR1NMa7xy9vV6Ka5cexb01/4/ggEIjPqHK9b1CbUXf1jX8WW3LGoE4v076vEGNYMFhBWDyY5Byy X-Received: by 10.194.246.161 with SMTP id xx1mr28970725wjc.26.1443538347949; Tue, 29 Sep 2015 07:52:27 -0700 (PDT) X-Received: by 10.194.246.161 with SMTP id xx1mr28970711wjc.26.1443538347814; Tue, 29 Sep 2015 07:52:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.98.214 with HTTP; Tue, 29 Sep 2015 07:52:08 -0700 (PDT) In-Reply-To: References: <20150929124344.GA13383@pl-59055.rocqadm.inria.fr> From:Yaron Minsky Date: Tue, 29 Sep 2015 10:52:08 -0400 Message-ID: To:Jesper Louis Andersen Cc:Gabriel Scherer , =?UTF-8?Q?S=C3=A9bastien_Hinderer?= , caml users Content-Type: text/plain; charset=UTF-8 X-JS-Processed-by: mailcore Subject: Re: [Caml-list] polymorphic sets? Core_kernel's maps and sets solve this problem, and address Gabriel's concern as well, by providing type witnesses that distinguish maps built with different comparators. There's an introduction to the use of these modules here: and you can see the current APIs here: Sets are handled similarly.For sure, better inlining (as is coming in Flambda!) can make this approach better. y On Tue, Sep 29, 2015 at 9:56 AM, Jesper Louis Andersen wrote: > > On Tue, Sep 29, 2015 at 2:58 PM, Gabriel Scherer > wrote: >> >> Note that the polymorphic sets (or maps) are less statically-safe than >> their functorized counterpart, because they are parametrized over their >> comparison function at creation time > > > The only point in time I've had troubles is when you have a map where its > values and keys range over a type that can recursively contain that map of > the same type. This required a polymorphic compare (from Core) to pull off. > > > -- > J.