<?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/72f5923f5c7f08eabc76024172d3b76b"
  from="james woodyatt &lt;jhw@w...&gt;"
  author="james woodyatt"
  date="2003-07-25T01:52:09"
  subject="Re: [Caml-list] Re: findlib-0.8.1 and ocaml-3.07+beta1"
  prev="2003/07/ed0d9014a56c9bede3d8c807b246cad0"
  next="2003/07/2aadf483f3e89d9c785e4c8aa61c83c5"
  prev-in-thread="2003/07/ed0d9014a56c9bede3d8c807b246cad0"
  next-in-thread="2003/07/ad9f0f2ad89ba5adecee3a27dbb127f5"
  prev-thread="2003/07/1ea3ba8ac1995e031abab081bf877be1"
  next-thread="2003/07/2aadf483f3e89d9c785e4c8aa61c83c5"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Re: findlib-0.8.1 and ocaml-3.07+beta1">
<msg 
  url="2003/07/21b30d51ac7b7eb8664b299a9cdf73e8"
  from="james woodyatt &lt;jhw@w...&gt;"
  author="james woodyatt"
  date="2003-07-25T00:27:47"
  subject="[Caml-list] Re: findlib-0.8.1 and ocaml-3.07+beta1">
<msg 
  url="2003/07/ed0d9014a56c9bede3d8c807b246cad0"
  from="Karl Zilles &lt;zilles@1...&gt;"
  author="Karl Zilles"
  date="2003-07-25T01:26:54"
  subject="Re: [Caml-list] Re: findlib-0.8.1 and ocaml-3.07+beta1">
<msg 
  url="2003/07/72f5923f5c7f08eabc76024172d3b76b"
  from="james woodyatt &lt;jhw@w...&gt;"
  author="james woodyatt"
  date="2003-07-25T01:52:09"
  subject="Re: [Caml-list] Re: findlib-0.8.1 and ocaml-3.07+beta1">
</msg>
</msg>
<msg 
  url="2003/07/ad9f0f2ad89ba5adecee3a27dbb127f5"
  from="pjd &lt;pjdurai@h...&gt;"
  author="pjd"
  date="2003-07-25T16:26:44"
  subject="Re: [Caml-list] Re: findlib-0.8.1 and ocaml-3.07+beta1">
</msg>
</msg>
</thread>

<contents>
On Thursday, Jul 24, 2003, at 18:28 US/Pacific, Karl Zilles wrote:
&gt; james woodyatt wrote:
&gt;&gt; I'm specifically excited about the polymorphic generalization of 
&gt;&gt; covariant parts of expansive expressions.
&gt;
&gt; I read about this in the changes document, but I'm unable to wrap my 
&gt; head around it.
&gt;
&gt; &gt; For instance, if f: unit -&gt; 'a list, "let x = f ()"
&gt; &gt; gives "x" the generalized type forall 'a. 'a list, instead of '_a 
&gt; list
&gt; &gt; as before.
&gt;
&gt; Can someone simplify this for me?  Under what circumstances would this 
&gt; be useful?

Sure.  I see it with functors.  Consider the following example:

	# module type X = sig
	    type +'a t
	    val f: unit -&gt; 'a t
	  end;;

This is a module type I plan to use as the input to a functor.  The top 
responds with this following:

	module type X = sig type +'a t val f : unit -&gt; 'a t end

So, imagine you want to write a functor like so:

	# module Y(X: X) = struct
	    let x = X.f ()
	  end;;

Here's what the 3.06 top-level says is the type of that module:

	module Y : functor (X : X) -&gt; sig val x : '_a X.t end

Here's what the 3.07+beta1 version says:

	module Y : functor (X : X) -&gt; sig val x : 'a X.t end

This is so much better.  In the 3.06 case, I get a module whose type 
isn't complete yet.  In the 3.07+beta1 case, I get a module whose type 
is complete.  With 3.06, I have to write 'x' as a function that returns 
a constructed object every time I call it.  With 3.07+beta1, I can 
write 'x' as a value that gets constructed once when the functor is 
called.


-- 
j h woodyatt &lt;jhw@wetware.com&gt;
that's my village calling... no doubt, they want their idiot back.

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

