From: Satoshi Ogasawara <ogasawara@itpl.co.jp>
To: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
Cc: caml-list <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] concept style using first-class module
Date: Wed, 13 Apr 2011 15:01:53 +0900 [thread overview]
Message-ID: <DBA9C08F-FBBD-4524-A983-3C3B79E6B990@itpl.co.jp> (raw)
In-Reply-To: <EE344C33-CC94-427E-ADFE-5D4B4BF8E011@math.nagoya-u.ac.jp>
-----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-----
prev parent reply other threads:[~2011-04-13 6:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-13 4:28 Satoshi Ogasawara
2011-04-13 5:27 ` Jacques Garrigue
2011-04-13 6:01 ` Satoshi Ogasawara [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DBA9C08F-FBBD-4524-A983-3C3B79E6B990@itpl.co.jp \
--to=ogasawara@itpl.co.jp \
--cc=caml-list@yquem.inria.fr \
--cc=garrigue@math.nagoya-u.ac.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox