From: Alexander Bernauer <bernauer@inf.ethz.ch>
To: <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] type of high order functions
Date: Thu, 16 Dec 2010 09:32:17 +0100 [thread overview]
Message-ID: <20101216083217.GC29535@apus.ethz.ch> (raw)
In-Reply-To: <4D087CDF.7000004@imag.fr>
[-- Attachment #1: Type: text/plain, Size: 767 bytes --]
On Wed, Dec 15, 2010 at 09:31:27AM +0100, Florent Ouchet wrote:
> >Why is it that the first example does not compile while the later ones do?
> Because type constraints are considered:
> - only for type restriction, not for generalization;
Hmm, I thought specifying a type is always a restriction compared to
saying nothing at all and thus allowing everything.
> - after the type inference algorithm is executed.
If I don't specify a type, what's the inferred type of f? If I restrict
f to the exact same type it should do no harm. At least, that is what I
expected.
So, I do understand your explanations but I don't understand the reasons
for them. I will go and consult the literature on the ML typing system.
Thank you all for your replies.
Greetings
Alex
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2010-12-16 8:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-14 20:30 Alexander Bernauer
2010-12-15 8:31 ` [Caml-list] " Florent Ouchet
2010-12-16 8:32 ` Alexander Bernauer [this message]
2010-12-16 8:46 ` bluestorm
2010-12-15 8:32 ` Alain Frisch
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=20101216083217.GC29535@apus.ethz.ch \
--to=bernauer@inf.ethz.ch \
--cc=caml-list@yquem.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