From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p3D62AuG030438 for ; Wed, 13 Apr 2011 08:02:10 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0BABU8pU3Y5v4vmWdsb2JhbACXSo49FAEBAQEBCAsLBxQlgQ2HbbtahW4EhVyIEINvG4kP X-IronPort-AV: E=Sophos;i="4.64,202,1301868000"; d="scan'208";a="96829582" Received: from amout07.alpha-mail.net ([216.230.254.47]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 13 Apr 2011 08:02:04 +0200 Received: from webarc05.alpha-mail.jp (webarc05 [216.230.254.85]) by amout07.alpha-mail.net with ESMTP id p3D61vgQ024502; Wed, 13 Apr 2011 15:01:57 +0900 X-Virus-Scanned: amavisd-new at Alpha-Mail Out Received: from ltsub02.alpha-mail.net (unknown [216.230.254.30]) by webarc05.alpha-mail.jp (Postfix) with ESMTP id B623DA48073; Wed, 13 Apr 2011 15:01:54 +0900 (JST) Received: from [192.168.0.100] (196.62.205.61.west.global.alpha-net.ne.jp [61.205.62.196]) by ltsub02.alpha-mail.net (Alpha-mail) with ESMTP id 1DF78746004B; Wed, 13 Apr 2011 15:01:56 +0900 (JST) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Satoshi Ogasawara In-Reply-To: Date: Wed, 13 Apr 2011 15:01:53 +0900 Cc: caml-list Message-Id: References: <4DA52686.40200@itpl.co.jp> To: Jacques Garrigue X-Pgp-Agent: GPGMail 1.3.3 X-Mailer: Apple Mail (2.1084) Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id p3D62AuG030438 Subject: Re: [Caml-list] concept style using first-class module -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Thank you for the very quick answer. On 2011/04/13, at 14:27, Jacques Garrigue wrote: > Unfortunately, you gave yourself the answer: one would need higher > kinded type variables to do that (they have them in Haskell). > Namely, in order to use M.t in the result, you need to bind it somewhere, > but a first-class module type cannot bind a type, and (type s) only works > with parameterless types. I understand it. > So you have to use a real functor here: > > module Foo(M:MonadPlus) = struct > let foo m = M.bind m (fun x -> M.return x) > end > > You can also wrap this functor in a first-class module, but I don't see > how it would help. By chance, I have just noticed a functor becomes first-class yesterday. I'll try this way. Thanks, ogasawara -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) iEYEARECAAYFAk2lPFEACgkQzTChtNfYLwZ/NwCfWzK0Pe7gUKvjW8jwGT6HNHCa ROwAnRUZ4O/4HE4ICZ9Jfn5Mnt/KchlC =iYVf -----END PGP SIGNATURE-----