caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Christian Stork <cstork@ics.uci.edu>
To: Caml List <caml-list@inria.fr>
Subject: UsingPolymorphic Variants
Date: Sat, 1 Oct 2005 17:06:09 -0700	[thread overview]
Message-ID: <20051002000609.GA30761@anthony.ics.uci.edu> (raw)

Basic Question:  

    Why aren't polymorphic variants coerced by default?

My Situation:

I am automatically generating some code that uses polymorphic variants
extensively.  The inferred types are very complicated.  Unfortunatly, at
some points in my code coercions are needed for it to compile.  Since I
don't have the types available when I generate the code (and I don't
think it's possible to refer to inferred types in coercions) I can't
coerce explicitly.  I'd like to be able to say something like:

    ... f (x: type_of_x :> type_expected_by_f) ...

Anyway, that's why I'm wondering why the compiler doesn't automatically
coerce or, at least, offer a switch with this functionality.

Thanks for your time,
Chris

-- 
Chris Stork   <>  Support eff.org!  <>   http://www.ics.uci.edu/~cstork/
OpenPGP fingerprint:  B08B 602C C806 C492 D069  021E 41F3 8C8D 50F9 CA2F


             reply	other threads:[~2005-10-02  0:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-02  0:06 Christian Stork [this message]
     [not found] ` <433F9DBE.6020509@gaillourdet.net>
2005-10-02 16:45   ` [Caml-list] Using Polymorphic Variants Christian Stork
2005-10-03 13:55     ` Jacques Garrigue

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=20051002000609.GA30761@anthony.ics.uci.edu \
    --to=cstork@ics.uci.edu \
    --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;
as well as URLs for NNTP newsgroup(s).