<?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/12/95fe6760008ea6cd96ee4a24c07ce390"
  from="Alex Baretta &lt;alex@b...&gt;"
  author="Alex Baretta"
  date="2003-12-22T13:33:34"
  subject="[Caml-list] Polymorphic records typing question"
  prev="2003/12/e522814874d2e94650503cf689c10feb"
  next="2003/12/4c6ae63cd6b1e8a8f33149859cfd695c"
  next-in-thread="2003/12/c5862f388f18bdf2460db3f01d99f5fa"
  prev-thread="2003/12/e522814874d2e94650503cf689c10feb"
  next-thread="2003/12/4c6ae63cd6b1e8a8f33149859cfd695c"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Polymorphic records typing question">
<msg 
  url="2003/12/95fe6760008ea6cd96ee4a24c07ce390"
  from="Alex Baretta &lt;alex@b...&gt;"
  author="Alex Baretta"
  date="2003-12-22T13:33:34"
  subject="[Caml-list] Polymorphic records typing question">
<msg 
  url="2003/12/c5862f388f18bdf2460db3f01d99f5fa"
  from="Guillaume Marceau &lt;gmarceau@c...&gt;"
  author="Guillaume Marceau"
  date="2003-12-22T20:26:27"
  subject="Re: [Caml-list] Polymorphic records typing question">
</msg>
</msg>
</thread>

<contents>
Here's a puzzle for the Caml breeders:

# type poly = { f : 'a . 'a -&gt; 'a };;
type poly = { f : 'a. 'a -&gt; 'a; }
# let id x = x;;
val id : 'a -&gt; 'a = &lt;fun&gt;
# let foo = { f = id };;
val foo : poly = {f = &lt;fun&gt;}
# let rec id x = x and foo = { f = id } ;;
This field value has type 'a -&gt; 'a which is less general than 'b. 'b -&gt; 'b

Why is this last recursive definition unacceptable?

Alex

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

