From: rixed@happyleptic.org
To: caml-list@inria.fr
Subject: Re: [Caml-list] Strange behavior from type inference after functor application
Date: Thu, 31 May 2012 23:22:29 +0200 [thread overview]
Message-ID: <20120531212229.GB28948@yeeloong.happyleptic.org> (raw)
In-Reply-To: <CAPFanBFM6cqcutZUq9m=x6v-yEYT4LPGF1Zpv-Pp_WrXFfKQcw@mail.gmail.com>
-[ Thu, May 31, 2012 at 10:23:13PM +0200, Gabriel Scherer ]----
> The problem with
> module C = Combi (S) (TypeWithConf (struct let v = 1 end))
> is that the resulting type has no "name": (struct let v = 1 end) can
> not be part of a type path.
So in order for the compiler to infer a type the type must have a 'name'?
That's funny because this 'name' is not used anywhere. Couldn't just
such anonymous modules be given random names so that everything works as
long as these names are unused? I mean, in the given example no type of
this Conf module was required to infer that C.t is a product type (which
was everything needed since f was returning the first value).
Or would it be just too obscure and not useful enough?
Anyway, thank you for the explanation. Hopefully I will remember it for
the next encounter.
next prev parent reply other threads:[~2012-05-31 21:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-31 20:05 rixed
2012-05-31 20:23 ` Gabriel Scherer
2012-05-31 21:22 ` rixed [this message]
2012-05-31 22:36 ` Andreas Rossberg
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=20120531212229.GB28948@yeeloong.happyleptic.org \
--to=rixed@happyleptic.org \
--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