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 E084C7EE51 for ; Sat, 13 Apr 2013 09:34:04 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.220.175; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.220.175 as permitted sender) identity=mailfrom; client-ip=209.85.220.175; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@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-vc0-f175.google.com) identity=helo; client-ip=209.85.220.175; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-vc0-f175.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ag4CAMQJaVHRVdyvm2dsb2JhbABQgzzBan4IFg4BAQEBAQYLCwkUKIIfAQEFJxkBGx0BAwwGBQsNLiEBAREBBQEcBhOIAQEDDwyeIIwvgnuELQoZJw1ZiH4BBQyMOIJTB4NBA5UfgWOBIYpUgzoWKYQwOg X-IPAS-Result: Ag4CAMQJaVHRVdyvm2dsb2JhbABQgzzBan4IFg4BAQEBAQYLCwkUKIIfAQEFJxkBGx0BAwwGBQsNLiEBAREBBQEcBhOIAQEDDwyeIIwvgnuELQoZJw1ZiH4BBQyMOIJTB4NBA5UfgWOBIYpUgzoWKYQwOg X-IronPort-AV: E=Sophos;i="4.87,466,1363129200"; d="scan'208";a="10821524" Received: from mail-vc0-f175.google.com ([209.85.220.175]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 13 Apr 2013 09:34:04 +0200 Received: by mail-vc0-f175.google.com with SMTP id ib11so2730649vcb.6 for ; Sat, 13 Apr 2013 00:34:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=m0egoR7f41cS/ZC3fJ5p99Esxtbdqd2msiblT+Dp7Zk=; b=ADDF2YaSupdP8Dpe5WJpgCzmtPm3FnbnjIG/tDyEEDK0VRurKEhsg3Zeweb6F6iIfI QwOEmI6F1pjnO8NzLkqCDowsm7/V9hUAIMtg6opKDUzZ/ynNG8iyfLDn65PFzwvTb0cF afFQy71gj1JTvufT1tp+cwav/uzlEmQmLo0ESnlDFleY3cttGMKiY7hLsrjXV8jYBVRI v0z/zd3YOdT8XFfFVKzO2pdQAqPPtF+yybAcQEb2fLLlPuOO17JusKJbBi5q/L50i7ML ra5JoCscGSB1t8o5YbVMuckPhfSOD5wb4qdZFbRkltBVs0OwoQ4eOaF6cEGOmBAkaF5W UdDA== X-Received: by 10.221.9.136 with SMTP id ow8mr10700336vcb.58.1365838442797; Sat, 13 Apr 2013 00:34:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.58.233.13 with HTTP; Sat, 13 Apr 2013 00:33:22 -0700 (PDT) In-Reply-To: References: From: Gabriel Scherer Date: Sat, 13 Apr 2013 09:33:22 +0200 Message-ID: To: Kakadu Cc: Anthony Tavener , "caml-list@inria.fr" Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Caml-list] Types look compatible, but they aren't? This looks like a value restriction issue with let m = Modifier.attach id "A function obtained through partial application is not polymorphic enough" http://caml.inria.fr/resources/doc/faq/core.en.html#eta-expansion If this is indeed the source of your error, you can regain type-checking by using instead let m total = Modifier.attach id total Note that this may change the semantics of your code if (Modifier.attach id) does a side-effect before getting its next parameter: if would have been effected only once with your previous definition, and will be effected at each call of 'm' with the new definition. On Sat, Apr 13, 2013 at 8:56 AM, Kakadu wrote: > Maybe function type (int * int -> int * int) is incompatible with object > type <..>? > > Kakadu > > > On Sat, Apr 13, 2013 at 10:50 AM, Anthony Tavener > wrote: >> >> File "virtue.ml", line 462, characters 12-24: >> Error: This expression has type >> int * ((int * int -> int * int) list -> exn) * >> (exn -> (int * int -> int * int) list) >> but an expression was expected of type >> int * ((< .. > as 'a) list -> exn) * (exn -> 'a list) >> >> The code in question: >> >> (fun id -> >> let m = Modifier.attach id in >> [ m Cast.total'k (fun (v,b) -> (v, max 1 (b-3))) (* <-- line 462 >> *) >> ; m Lab.total'k (fun (v,b) -> (v, max 1 (b-3))) ]) >> >> For reference, the signature of Modifier.attach: >> Db.key -> int * ('a list -> exn) * (exn -> 'a list) -> 'a -> >> Modifier.deleter >> >> OCaml version is 4.00.0 -- I know I should upgrade. Keep meaning to, I >> guess I will if I wake up and there's no helpful soul explaining what >> could >> be wrong here. :) >> >> Thank-you for any help. My eyes are starting to bug-out looking at this. >> >> -Tony >> >> >