From: Dave Berry <dave@kal.com>
To: John Max Skaller <skaller@ozemail.com.au>,
Mattias Waldau <mattias.waldau@tacton.se>
Cc: caml-list@inria.fr
Subject: RE: ROverloading
Date: Mon, 18 Dec 2000 15:27:03 -0000 [thread overview]
Message-ID: <3145774E67D8D111BE6E00C0DF418B66395AEC@nt.kal.com> (raw)
John Max Skaller wrote:
> Unfortunately, overloading isn't quite so simple when
> you've also got type inference:
That depends on how general you try to be. I'd be quite happy with a system
that allowed multiple definitions of a name, but forced applications to be
monomorphic. In your example, the definition of f would require a
disambiguating type annotation (or assume a default):
> let f a b = a + b in
> let x = f 1.0 2.0 in
> let y = f 1 2 in
would become
let f a b = a + b : int in ...
Theoretically inelegant, but pragmatically sufficient. As indeed you seem
to be doing in Felix.
I'd use the module system to introduce and control overloading, rather than
trying to extend the core language. It seems a simpler route.
Dave.
next reply other threads:[~2000-12-18 17:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-12-18 15:27 Dave Berry [this message]
2000-12-19 6:45 ` ROverloading John Max Skaller
-- strict thread matches above, loose matches on Subject: below --
2000-12-15 13:39 Functions must be explicitly typed, (was Same label in different types, how do people solve this?) Mattias Waldau
2000-12-16 14:10 ` ROverloading John Max Skaller
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=3145774E67D8D111BE6E00C0DF418B66395AEC@nt.kal.com \
--to=dave@kal.com \
--cc=caml-list@inria.fr \
--cc=mattias.waldau@tacton.se \
--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;
as well as URLs for NNTP newsgroup(s).