caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Leo White <lpw25@cam.ac.uk>
To: Arnaud Spiwack <arnaud@spiwack.net>
Cc: OCaML Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] Manipulating Modules Modularly
Date: Tue, 21 Oct 2014 15:52:42 +0100	[thread overview]
Message-ID: <86fveho4p1.fsf@cam.ac.uk> (raw)
In-Reply-To: <CAMoPVjdDR29uhje0Rhy3ketOWKCbLa=HHf4RGb87xpgv+Gf62w@mail.gmail.com> (Arnaud Spiwack's message of "Tue, 21 Oct 2014 15:19:44 +0200")

> Am I weird to run into this issue all the time or is it common?

Depends which issue you mean.

People run into the value restriction quite frequently but eta-expansion
is usually considered an acceptable solution, although it does require a
certain amount of boilerplate.

Note that your problem can also be worked around for a fixed number of
type parameters by defining your module types as:

    module type M = sig
        type 'a t
        val u : 'a t
        val p : 'a t -> 'a t -> 'a t
      end

    module type ME = sig
       type 'a t
       val ps: 'a t list -> 'a t
    end

which will now work for types with 0 or 1 parameters.

> PS: now that there are both applicative functors and generative functors, could applicative functors be restricted to
> being pure, so that this sort of manipulation become possible in a generic way?

That would break a lot of existing code and wouldn't work very well
without a full effect system in the core language.

Regards,

Leo

  reply	other threads:[~2014-10-21 14:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-21  8:52 Arnaud Spiwack
2014-10-21 12:26 ` Leo White
2014-10-21 12:47   ` Leo White
2014-10-21 13:19     ` Arnaud Spiwack
2014-10-21 14:52       ` Leo White [this message]
2014-10-22  9:51         ` Arnaud Spiwack

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=86fveho4p1.fsf@cam.ac.uk \
    --to=lpw25@cam.ac.uk \
    --cc=arnaud@spiwack.net \
    --cc=caml-list@inria.fr \
    /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;
as well as URLs for NNTP newsgroup(s).