<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/07/0dc9c6a5ce74286444025417ac016873"
  from="Julien Signoles &lt;Julien.Signoles@l...&gt;"
  author="Julien Signoles"
  date="2003-07-03T16:18:11"
  subject="[Caml-list] variant and functor"
  prev="2003/07/c8147b1a3fde487932256f4013f9c14f"
  next="2003/07/6a59432f708b13ca5d40751041049c7a"
  prev-thread="2003/07/c8147b1a3fde487932256f4013f9c14f"
  next-thread="2003/07/6a59432f708b13ca5d40751041049c7a"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] variant and functor">
<msg 
  url="2003/07/0dc9c6a5ce74286444025417ac016873"
  from="Julien Signoles &lt;Julien.Signoles@l...&gt;"
  author="Julien Signoles"
  date="2003-07-03T16:18:11"
  subject="[Caml-list] variant and functor">
</msg>
</thread>

<contents>
Hi list,

I have the following functor :

module Make(A : sig type a val f : a -&gt; int end) =
struct
  type t = [ A.a | `B ]
          (* impossible : A.a is abstract and not a variant *)

  let foo = function
    | #A.a as a -&gt; A.f a (* no assumption about the tags of A.a *)
    | `B        -&gt; 0

end

I'd like to know if it is possible to describe A.a as a variant type
without write its tags.

Cheers,
Julien Signoles.
-- 
mailto : Julien.Signoles@lri.fr ; http : www.lri.fr/~signoles
"In theory, practice and theory are the same,
but in practice they are different" (Larry McVoy)

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

</contents>

</message>

