Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006225OCamldocumentationpublic2013-11-05 00:002017-10-16 08:58
ReporterDYNO_doxa 
Assigned Tooctachron 
PrioritylowSeverityminorReproducibilityN/A
StatusresolvedResolutionfixed 
Platformi386OSXPOS VersionSP3
Product Version4.01.0 
Target VersionFixed in Version4.06.0+dev 
Summary0006225: weak variables '_a should be documented in the manual
DescriptionDefining

  let new_array = Array.make 7

returns a surprising type

  '_a -> '_a array

that is not documented in the manual.
Steps To Reproducecompile and see:

module Days = struct
    let newArrayOf = Array.make 7
end
Tagsjunior_job
Attached Files

- Relationships
related to 0005607resolvedoctachron FAQ suggestion: explain the interaction between (relaxed) value restriction and variance annotations 

-  Notes
(0010586)
yallop (developer)
2013-11-05 00:58

The function receives a weakly polymoprhic type, which is the expected behaviour:

   module Days : sig val newArrayOf : '_a -> '_a array end

See the FAQ entries:

   The type of this expression contains type variables that cannot be generalized
   http://caml.inria.fr/resources/doc/faq/core.en.html#weak-type-variables [^]

   A function obtained through partial application is not polymorphic enough
   http://caml.inria.fr/resources/doc/faq/core.en.html#eta-expansion [^]
(0010587)
DYNO_doxa (reporter)
2013-11-05 01:13

no mention of "weakly polymoprhic [!] type" in the manual, though
(0010588)
gasche (developer)
2013-11-05 10:05

This is a documentation issue (I thought there were documented outside the fact, but couldn't find the reference again). I updated the PR to reflect that this is not a bug.
(0018579)
octachron (developer)
2017-10-16 08:58

The new chapter on polymorphic functions and types introduces explicitly the notion of weakly polymorphic types (which were already mentionned in the FAQ of the compiler chapter).

- Issue History
Date Modified Username Field Change
2013-11-05 00:00 DYNO_doxa New Issue
2013-11-05 00:58 yallop Note Added: 0010586
2013-11-05 01:13 DYNO_doxa Note Added: 0010587
2013-11-05 10:05 gasche Priority normal => low
2013-11-05 10:05 gasche Severity minor => trivial
2013-11-05 10:05 gasche Reproducibility always => N/A
2013-11-05 10:05 gasche Status new => acknowledged
2013-11-05 10:05 gasche Category OCaml standard library => OCaml documentation
2013-11-05 10:05 gasche Summary wrong signature for Array.make => weak variables '_a should be documented in the manual
2013-11-05 10:05 gasche Description Updated View Revisions
2013-11-05 10:05 gasche Note Added: 0010588
2014-02-19 16:40 doligez Severity trivial => minor
2014-06-19 17:56 gasche Tag Attached: junior_job
2014-07-16 17:20 doligez Target Version => 4.02.0+dev
2014-07-16 17:20 doligez Target Version 4.02.0+dev => 4.02.1+dev
2014-09-04 00:25 doligez Target Version 4.02.1+dev => undecided
2014-09-15 13:56 doligez Target Version undecided => 4.03.0+dev / +beta1
2016-04-05 16:07 doligez Target Version 4.03.0+dev / +beta1 => 4.03.1+dev
2017-02-16 14:01 doligez Target Version 4.03.1+dev => undecided
2017-02-23 16:35 doligez Category OCaml documentation => Documentation
2017-02-23 16:44 doligez Category Documentation => documentation
2017-03-15 11:31 doligez Target Version undecided =>
2017-03-15 12:32 octachron Relationship added related to 0005607
2017-10-16 08:58 octachron Note Added: 0018579
2017-10-16 08:58 octachron Status acknowledged => resolved
2017-10-16 08:58 octachron Fixed in Version => 4.06.0+dev
2017-10-16 08:58 octachron Resolution open => fixed
2017-10-16 08:58 octachron Assigned To => octachron


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker