From: Tomasz Zielonka <zielony@cs.net.pl>
To: Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Narrowing coercions for functions with optional parameters
Date: Mon, 25 Feb 2002 10:44:11 +0100 [thread overview]
Message-ID: <20020225094411.GA24739@cs.net.pl> (raw)
In-Reply-To: <20020225102930F.garrigue@kurims.kyoto-u.ac.jp>
On Mon, Feb 25, 2002 at 10:29:30AM +0900, Jacques Garrigue wrote:
> From: Tomasz Zielonka <zielony@cs.net.pl>
>
> There is a common misunderstanding on the meaning of (e :> t). It
> indeed allows some kind of coercion, but it does it by building a
> generic subtype of t, which is then unified to the type of e.
> [...]
Thanks for explanation.
> So the answer is: because implicit "coercions" work ok on some
> specific syntactical cases, but cannot easily be generalized to full
> coercions.
>
> So, you are stuck with (fun x -> g x), which is in fact shorter than
> (g : ?add:int -> int -> int :> int -> int).
No problem.
PS. Labels in OCaml are great :)
tom
--
.-. Tomasz Zielonka CYBER SERVICE
oo| programista http://www.cs.net.pl
/`'\ zielony@cs.net.pl
(\_;/) tel: [48] (22) 723-06-79 | tel/fax: [48] (22) 723-01-75
-------------------
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
prev parent reply other threads:[~2002-02-25 9:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-24 14:01 Tomasz Zielonka
2002-02-24 18:33 ` Stefano Zacchiroli
2002-02-24 19:50 ` Tomasz Zielonka
2002-02-25 1:29 ` Jacques Garrigue
2002-02-25 9:44 ` Tomasz Zielonka [this message]
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=20020225094411.GA24739@cs.net.pl \
--to=zielony@cs.net.pl \
--cc=caml-list@inria.fr \
--cc=garrigue@kurims.kyoto-u.ac.jp \
/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