From: brogoff@speakeasy.net
To: "Jun.Furuse@inria.fr" <Jun.Furuse@inria.fr>
Cc: Pierre Weis <pierre.weis@inria.fr>,
Oleg Trott <oleg_trott@columbia.edu>,
John Max Skaller <skaller@ozemail.com.au>,
"caml-list@inria.fr" <caml-list@inria.fr>
Subject: Re: easy print and read (was: [Caml-list] Why are arithmetic functions not polymorph?)
Date: Sat, 7 Jun 2003 23:32:41 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.44.0306072319220.6011-100000@grace.speakeasy.net> (raw)
In-Reply-To: <lwof1agd5r.wl@inria.fr>
On Sat, 7 Jun 2003, Jun.Furuse@inria.fr wrote:
> Yes, in this case, it is easy to tell that there is only one
> applicable typing for plus one two, that is plus : float -> float -> float.
> But in general, nubmer of type case combinations may increase quite
> easily and searching applicable typing from them becomes quite inefficient.
> Moreover, when we have recursive generic values, the search space may
> be infinite! Therefore, we must restrict the search space of type case
> combinations in some manner (otherwise, typing may never terminates).
>
> The restriciton in the G'Caml implementation is quite simple,
> therefore you may feel some inconvenience: the type of plus one two
> is not inferred automatically, for example.
Hi,
I understand the pragmatics. If it turns out that this is painful in
practice for cases like linear algebra or numerics libraries where the
generic values are not recursive, I hope that a less restrictive rule can be
adopted. I don't think that the hacks used by other languages which have
types which throw the type checker into a loop (setting some iteration limit)
are so bad, and I think they can be applied here.
Right now we don't have any significant practice to go on, so I think the
conservative rule is OK, since, as you point out, it is simple. It's a bit
weird that the example I posted works if the order is switched in the
declaration of "plus".
-- Brian
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
next prev parent reply other threads:[~2003-06-08 6:32 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-22 22:31 [Caml-list] Why are arithmetic functions not polymorph? hermanns
2003-05-22 23:10 ` Brian Hurt
2003-05-23 1:34 ` Nicolas Cannasse
2003-05-23 9:56 ` David Monniaux
2003-05-23 10:13 ` Ville-Pertti Keinonen
2003-05-23 16:34 ` brogoff
2003-05-23 18:02 ` Brian Hurt
2003-05-23 18:12 ` Matt Gushee
2003-05-23 20:25 ` brogoff
2003-05-23 21:15 ` Brian Hurt
2003-05-23 21:23 ` brogoff
2003-06-03 3:42 ` John Max Skaller
2003-06-03 4:10 ` Oleg Trott
2003-06-03 6:57 ` John Max Skaller
2003-06-03 3:25 ` John Max Skaller
2003-06-06 7:08 ` easy print and read (was: [Caml-list] Why are arithmetic functions not polymorph?) Oleg Trott
2003-06-06 10:46 ` Pierre Weis
2003-06-06 16:40 ` brogoff
2003-06-07 10:59 ` Stefano Zacchiroli
2003-06-07 14:44 ` Jun.Furuse
2003-06-08 6:32 ` brogoff [this message]
2003-06-08 8:49 ` Chris Hecker
2003-06-09 9:40 ` Jun.Furuse
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=Pine.LNX.4.44.0306072319220.6011-100000@grace.speakeasy.net \
--to=brogoff@speakeasy.net \
--cc=Jun.Furuse@inria.fr \
--cc=caml-list@inria.fr \
--cc=oleg_trott@columbia.edu \
--cc=pierre.weis@inria.fr \
--cc=skaller@ozemail.com.au \
/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