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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 389D77FAE1 for ; Fri, 19 Dec 2014 14:30:40 +0100 (CET) X-IronPort-AV: E=Sophos;i="5.07,606,1413237600"; d="scan'208";a="114170345" Received: from vl21-pfc1.u-bourgogne.fr (HELO alcazar2) ([193.52.245.13]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 19 Dec 2014 14:30:40 +0100 Date: Fri, 19 Dec 2014 14:30:39 +0100 From: Maxence Guesdon To: "caml-list@inria.fr" Message-ID: <20141219143039.425107b3@alcazar2> Organization: INRIA X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.23; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [Caml-list] Function not polymorphic enough Hello, With the following code: let (fn, extend) = let module M = struct type t = { mutable f : 'a. ('a -> unit) -> 'a list -> unit } let v = { f = fun (type a) -> fun (poly_a : a -> unit) -> fun _ -> assert false } end in let fn = fun f x -> M.v.M.f x in let extend g = M.v.M.f <- g M.v.M.f in (fn, extend) I get the following message about " g M.v.M.f": Error: This field value has type ('b -> unit) -> 'b list -> unit which is less general than 'a. ('a -> unit) -> 'a list -> unit Does anyone know how to make "g M.v.M.f" general enough ? Regards, Maxence