caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* UsingPolymorphic Variants
@ 2005-10-02  0:06 Christian Stork
       [not found] ` <433F9DBE.6020509@gaillourdet.net>
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Stork @ 2005-10-02  0:06 UTC (permalink / raw)
  To: Caml List

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-10-03 13:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-02  0:06 UsingPolymorphic Variants Christian Stork
     [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

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).