Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005067OCamlOCamldocpublic2010-06-05 15:452014-09-26 17:47
Reporterbluestorm 
Assigned Toguesdon 
PrioritynormalSeverityminorReproducibilityN/A
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version 
Target Version4.02.2+devFixed in Version 
Summary0005067: ocamldoc doesn't preserve type contraints and `_`, producing unreadable interfaces
DescriptionOcamldoc doesn't preserve type constaints (type .. = ... constraint ..) and type placeholders in values (val foo : .. -> _) : they are resolved during type inference, and ocamldoc gives back the fully detailed types wich are sometimes unreadable.

It would be very nice to have an option to reuse the type information present in the .mli without additional inference.
Additional InformationIn [Macaque], I use a lot of phantom types carrying multiple type informations : I use object types as a type-level record, wich leads to quite heavy datatypes. I use the "constraint" feature and "_" for values specifications to have a readable [interface]. For example :


 type 'phant binary_op = 'a t -> 'b t -> 'c t
 constraint 'a = < t : 'in_t; nul : 'n; .. >
 constraint 'b = < t : 'in_t; nul : 'n; .. >
 constraint 'c = < t : 'out_t; nul : 'n >
 constraint 'phant =
   < in_t : 'in_t; out_t : 'out_t; nul : 'n; a : 'a; b : 'b >

 type 'phant arith_op = 'phant binary_op
 constraint 'phant = < in_t : #numeric_t as 't; out_t : 't; .. >

 val (+) : _ arith_op
 val (-) : _ arith_op
 val (/) : _ arith_op
 val ( * ) : _ arith_op


My problem is that ocamldoc produces utterly unreadable results :

 type < a : < nul : 'a; t : 'b; .. >; b : < nul : 'a; t : 'b; .. >; in_t : 'b;
      nul : 'a; out_t : 'c > binary_op = (< nul : 'a; t : 'b; .. > as 'd) t ->
      (< nul : 'a; t : 'b; .. > as 'e) t -> < nul : 'a; t : 'c > t


 type < a : < nul : 'a; t : #Sql.numeric_t as 'b; .. >;
      b : < nul : 'a; t : 'b; .. >; in_t : 'b; nul : 'a; out_t : 'b >
 arith_op = < a : < nul : 'a; t : 'b; .. > as 'c; b : < nul : 'a; t : 'b; .. > as 'd;
        in_t : 'b; nul : 'a; out_t : 'b >
      Sql.binary_op

 val (+) : < a : < nul : 'a; t : #Sql.numeric_t as 'b; .. >;
        b : < nul : 'a; t : 'b; .. >; in_t : 'b; nul : 'a; out_t : 'b >
      arith_op


 [Macaque] http://macaque.forge.ocamlcore.org/ [^]
 [interface] http://darcs.ocamlcore.org/cgi-bin/darcsweb.cgi?r=macaque;a=plainblob;f=/src/sql.mli [^]
TagsNo tags attached.
Attached Files

- Relationships
related to 0005294closedguesdon Ocamldoc does not keep ".mli" names of polymorphic types 

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2010-06-05 15:45 bluestorm New Issue
2010-06-05 15:45 bluestorm Status new => assigned
2010-06-05 15:45 bluestorm Assigned To => guesdon
2012-07-10 20:21 doligez Target Version => 4.01.0+dev
2012-07-31 13:36 doligez Target Version 4.01.0+dev => 4.00.1+dev
2012-09-18 13:22 doligez Target Version 4.00.1+dev => 4.01.0+dev
2012-09-20 16:24 doligez Relationship added related to 0005294
2013-08-19 11:56 doligez Target Version 4.01.0+dev => 4.01.1+dev
2014-05-25 20:20 doligez Target Version 4.01.1+dev => 4.02.0+dev
2014-07-30 23:11 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-26 17:47 doligez Target Version undecided => 4.02.2+dev


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker