<?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="2009/01/1bb09ae5ed2be27df3bc53c7ed24caed"
  from="Jacques Carette &lt;carette@m...&gt;"
  author="Jacques Carette"
  date="2009-01-20T18:04:49"
  subject="Re: [Caml-list] polymorphic variants, long form"
  prev="2009/01/746318635c69a7f8e8381ecb87c7a93b"
  next="2009/01/50a5d1b536ba93ef89f0ef275d1e9286"
  prev-in-thread="2009/01/adf712350410913b2c0a8a14ea5ea8e5"
  next-in-thread="2009/01/75e8db2f49bd671bea94e4a725849785"
  prev-thread="2009/01/fa6c4452c1d8f79eeb50fa71a9e2e430"
  next-thread="2009/01/50a5d1b536ba93ef89f0ef275d1e9286"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="polymorphic variants, long form">
<msg 
  url="2009/01/44166bc88a034e1581bc385cbd06574b"
  from="Jacques Carette &lt;carette@m...&gt;"
  author="Jacques Carette"
  date="2009-01-20T17:37:35"
  subject="polymorphic variants, long form">
<msg 
  url="2009/01/adf712350410913b2c0a8a14ea5ea8e5"
  from="luc.maranget@i..."
  author="luc.maranget@i..."
  date="2009-01-20T17:39:58"
  subject="Re: [Caml-list] polymorphic variants, long form">
<msg 
  url="2009/01/1bb09ae5ed2be27df3bc53c7ed24caed"
  from="Jacques Carette &lt;carette@m...&gt;"
  author="Jacques Carette"
  date="2009-01-20T18:04:49"
  subject="Re: [Caml-list] polymorphic variants, long form">
<msg 
  url="2009/01/75e8db2f49bd671bea94e4a725849785"
  from="Romain Bardou &lt;Romain.Bardou@l...&gt;"
  author="Romain Bardou"
  date="2009-01-21T09:38:41"
  subject="Re: [Caml-list] polymorphic variants, long form">
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>
Luc Maranget wrote:
&gt;&gt; What is the proper 'long name' of a polymorphic variant?
&gt;&gt; module S = struct type a = [`Foo of int] end
&gt;&gt;
&gt;&gt; How do I refer to `Foo without opening S?  Both S.`Foo and `S.Foo are 
&gt;&gt; syntax errors.
&gt;&gt;
&gt;&gt; Jacques
&gt;&gt;     
&gt;
&gt; 'Foo does the job, it does not refer to any previous type definition.
&gt;
&gt; % ocaml
&gt;         Objective Caml version 3.11.0
&gt;
&gt; # `Foo;;
&gt; - : [&gt; `Foo ] = `Foo
&gt;   
Just  a few minutes after I sent my email, I remembered the answer 
myself: unlike normal variants, polymorphic variants are not scoped but 
affect the namespace in a GLOBAL way.  Both extremely convenient and 
non-modular at the same time.

Jacques

</contents>

</message>

