You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 5067 Reporter: bluestorm Status: confirmed (set by @gasche on 2016-04-18T18:39:06Z) Resolution: open Priority: normal Severity: text Target version: 4.07.0+dev/beta2/rc1/rc2 Category: ocamldoc Related to:#5294 Monitored by:@gasche "Julien Signoles"
Bug description
Ocamldoc 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 information
In [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
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.
I filed this issue ten years ago, and it is pretty clear to me that ocamldoc is not going to get radical improvements in the future, only easier incremental fixes. Maybe odoc will be able to handle this better. Closing.
Original bug ID: 5067
Reporter: bluestorm
Status: confirmed (set by @gasche on 2016-04-18T18:39:06Z)
Resolution: open
Priority: normal
Severity: text
Target version: 4.07.0+dev/beta2/rc1/rc2
Category: ocamldoc
Related to: #5294
Monitored by: @gasche "Julien Signoles"
Bug description
Ocamldoc 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 information
In [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
The text was updated successfully, but these errors were encountered: