caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] reverse coercions
@ 2016-06-10 18:12 Hendrik Boom
  2016-06-10 18:25 ` dario.teixeira
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Hendrik Boom @ 2016-06-10 18:12 UTC (permalink / raw)
  To: caml-list

In http://caml.inria.fr/pub/docs/u3-ocaml/ocaml-objects.html it says:

reverse coercions from a supertype to a supertype are never possible in 
OCaml.

(a) Might one of these 'supertype's  actually be a 'subtype'?

(b) Is there any way to do a run-time type-test on a value of a 
specific statically known supertype to test whether it is actually a 
value of a known specified subtype, and if so to proceed to use it as 
that subtype?

If so, I'd like to use this in a suite of pattern-directed rule 
invocations.

If not, I'd like to know if there are any well-known efficient ways 
around this.  Of course I can effectively Godel-encode my data 
structures using lists, and interpret all my patterns and the 
application types I woyd have rather expressed as OCaml types, but I'm 
looking for something more elegant, statically checked,  and 
efficient.

-- hendrik

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

end of thread, other threads:[~2016-06-10 20:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-10 18:12 [Caml-list] reverse coercions Hendrik Boom
2016-06-10 18:25 ` dario.teixeira
2016-06-10 19:05   ` [Caml-list] octothorpes and backticks? Hendrik Boom
2016-06-10 20:04     ` Anthony Tavener
2016-06-10 18:34 ` [Caml-list] reverse coercions Gerd Stolpmann
     [not found] ` <CAPFanBFa+MJzvt_KYmReuHSzRpD=fT=nEaXB4c7dMwWSL3w7Vg@mail.gmail.com>
2016-06-10 18:59   ` Hendrik Boom

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