From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr 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 A3B507EF5E for ; Mon, 25 Jul 2016 11:36:26 +0200 (CEST) IronPort-PHdr: 9a23:03PzGx+NOJvGm/9uRHKM819IXTAuvvDOBiVQ1KB92+wcTK2v8tzYMVDF4r011RmSDN2dtasP07eempujcFRI2YyGvnEGfc4EfD4+ouJSoTYdBtWYA1bwNv/gYn9yNs1DUFh44yPzahANS47AblHf6ke/8SQVUk2mc1EkfqKrQ8WK0oye7KObw9XreQJGhT6wM/tZDS6dikHvjPQQmpZoMa0ryxHE8TNicuVSwn50dxrIx06vru/5xpNo8jxRtvQ97IYAFPyiJ+VrBYBfWREvN2sy4MijkBDfRA+M7zNIV2AfjhNMAAHt4xTzX5O3uSz/4LlTwi6faPfxQbcwQTSvp4NmUB7nkipPYyQ+/GbTksx9yqZWuBOuvRFX3ojVfsSOPeR5f66bc8lMFjkJZdpYSyEUWtD0VIAIFedUeL8A94Q= Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=rlepigre@gmail.com; spf=Pass smtp.mailfrom=rlepigre@gmail.com; spf=None smtp.helo=postmaster@mail-wm0-f47.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of rlepigre@gmail.com) identity=pra; client-ip=74.125.82.47; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="rlepigre@gmail.com"; x-sender="rlepigre@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of rlepigre@gmail.com designates 74.125.82.47 as permitted sender) identity=mailfrom; client-ip=74.125.82.47; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="rlepigre@gmail.com"; x-sender="rlepigre@gmail.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@mail-wm0-f47.google.com) identity=helo; client-ip=74.125.82.47; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="rlepigre@gmail.com"; x-sender="postmaster@mail-wm0-f47.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0B2AgBv3JVXfy9SfUpeFoN/fKxEjjqHNTsRAQEBAQEBAQERAQEJCwsJFzGCMgQBEgGCEwEFEhEECwENATgBAwwBBQUOAggCAgUhAgIPBQ0TAQUBIhMih3QDFwQKmA6BMj4xizuERAWEOScNg3cBCwEcAgYQcYMegguETYJDhH4rgi8FmHQ0gV+EOIYxgh2CRIcMhXlIh16GPDCBDzRYgz1siEgBAQE X-IPAS-Result: A0B2AgBv3JVXfy9SfUpeFoN/fKxEjjqHNTsRAQEBAQEBAQERAQEJCwsJFzGCMgQBEgGCEwEFEhEECwENATgBAwwBBQUOAggCAgUhAgIPBQ0TAQUBIhMih3QDFwQKmA6BMj4xizuERAWEOScNg3cBCwEcAgYQcYMegguETYJDhH4rgi8FmHQ0gV+EOIYxgh2CRIcMhXlIh16GPDCBDzRYgz1siEgBAQE X-IronPort-AV: E=Sophos;i="5.28,418,1464645600"; d="scan'208";a="185851249" Received: from mail-wm0-f47.google.com ([74.125.82.47]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 25 Jul 2016 11:36:25 +0200 Received: by mail-wm0-f47.google.com with SMTP id i5so147629405wmg.0 for ; Mon, 25 Jul 2016 02:36:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=DYOUKYNsbcChYOqvfWF8hd3MJzcv+/ybTjjwjhH0jAA=; b=DyhVLRXDDktkCrfu+DFQ/Bp+1YSEfNtRhJHHeZb/whbCjt5Xdn2MrCdySKXDBxrkZ9 orSjRKc1LyoTBASWFsW2Exh2/7dsyUZvyDbQupGM/H3i8d7qtioV19Lx1fUsl/zIv/+P X8RyrOONwOOpWs8c9tWDUu8CDfACu5Gmu+J5HxUMxUmVXOo5tGzZYs6KiX1XyZ6zb7+a pa8FNzzvect9ed7AJcL//0PEq0J99PPPAxPLdahFdtNWXFO0/ySvgtppltZ2L+ojRXQD RGaswDZsUd+ocWe1I2edyKqR7+sr4E3aRYMrc/9joCI3TD8lsIlsUN/vrcUKTFIOqTiq RZDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=DYOUKYNsbcChYOqvfWF8hd3MJzcv+/ybTjjwjhH0jAA=; b=lonefh3CApig3NDUT0YMyFTY79AacD3Ii02diuS6vlBBKJ6e+Ocol6R4rcibfrPiEg yDKVWEN6RjOq+r5KV8JD2k4icNlPtabRHvfPNRiPTCA4ctnjrexT5Qw0ENz74GW5FYsb a7txblEErkIbozAqjvFUQOno/xGR3mjhbnHpnXRN+quDa0IxSdpDNv+gqM8kaZL78ybB GVWqqG2B2hbTGmnn9CtcnEbMh0aQpLq5QyXuQPgSrTPCt4AslOFHOWHyzrwUv5OUMtld /+zL0ou0XRmF6obUV2RGSOXK8khDA6UiAaKlVTsm31wIToNtQ2U7UzL0Rfdu8PFBNaLh 0f7Q== X-Gm-Message-State: AEkoousR7ujewRXPefqw51Fz2AfN9YUtHiTyPN4aOAyR1167esGv+ic49oHziskXYrNAXA== X-Received: by 10.194.185.116 with SMTP id fb20mr15923235wjc.32.1469439385670; Mon, 25 Jul 2016 02:36:25 -0700 (PDT) Received: from localhost (nat-maths.univ-savoie.fr. [193.48.123.14]) by smtp.gmail.com with ESMTPSA id p23sm26505941wme.8.2016.07.25.02.36.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Jul 2016 02:36:24 -0700 (PDT) Sender: Rodolphe Lepigre Date: Mon, 25 Jul 2016 11:36:24 +0200 From: Rodolphe Lepigre To: Malcolm Matalka Cc: Christopher Zimmermann , caml-list@inria.fr Message-ID: <20160725093624.GC443@HPArchRod.localdomain> References: <86a8h77ziv.fsf@gmail.com> <20160724211726.71ac2036@mortimer.gmerlin.de> <8660ru83s2.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8660ru83s2.fsf@gmail.com> User-Agent: Mutt/1.6.2 (2016-07-01) Subject: Re: [Caml-list] 'b t doesn't equal '_b t? On 25/07/2016 09:29, Malcolm Matalka wrote: > Christopher Zimmermann writes: > > > '_b t is just not polymorphic. It just means the compiler could not yet > > figure out the monomorphic type of '_b. It will be bound to a > > monomorphic type later on. > > How does one track down and why this is happening? I tried adding some > typo annotations, but no luck. Maybe I didn't add them in the right > place or I added the wrong annotations? > > Any tips for handling this situation? Just use an explicit quantification on your definition of bind by doing something like: let bind : type a b. a t -> (a -> b t) -> b t = fun x y -> ... There are two main reasons why the right polymorphic type is not infered: 1) value restriction, 2) you are using polymorphic recursion. Cheers, Rodolphe -- Rodolphe Lepigre LAMA, Université Savoie Mont Blanc, FRANCE http://lama.univ-smb.fr/~lepigre/ > > > > > > > On 2016-07-24 Malcolm Matalka wrote: > >> I have the following error and I don't understand what the compiler is > >> trying to tell me. Any hints? > >> > >> Error: The implementation abb_fut.ml > >> does not match the interface abb_fut.cmi: > >> Values do not match: > >> val bind : 'a t -> ('a -> '_b t) -> '_b t > >> is not included in > >> val bind : 'a t -> ('a -> 'b t) -> 'b t > >> File "abb_fut.ml", line 118, characters 4-8: Actual declaration > >>