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
Right now, in Real World OCaml, every type definition is thrown back to the user, which is no what you want typically, since the type definition itself contains essentially the same information. It would be useful to have some flags to control this behavior, both on a block-by-block basis, and flags to set defaults at the tool invocation level, so we can set broad defaults.
I can think of three modes that would make sense to switch between.
Suppress nothing, which is the current behavior
Suppress types, suppress the restatement of top-level type-definitions only
Suppress all signatures, which would include val and module declarations. This would still let printed values through.
In all of the above, type errors should still come through. Note that in the case of type definitions with deriving clauses, like this one:
typet = int*int [@@deriving sexp
that one should expect the following in suppress-types mode:
valsexp_of_t : t -> Sexp.tvalt_of_sexp : Sexp.t -> t
i.e., the derived value declarations should come through, but not the types.
I propose that module declarations make it through in suppress-types mode, even if those modules contain only types.
Note that something close to the "suppress all" behavior is available by dropping the # syntax. But it would be good to have this control while still keeping the basic syntax. Indeed, in suppress types mode, it would be useful to have some lines that are type definitions and some that are value declarations in the same block, and have their behavior vary as suggested above.
The text was updated successfully, but these errors were encountered:
Right now, in Real World OCaml, every type definition is thrown back to the user, which is no what you want typically, since the type definition itself contains essentially the same information. It would be useful to have some flags to control this behavior, both on a block-by-block basis, and flags to set defaults at the tool invocation level, so we can set broad defaults.
I can think of three modes that would make sense to switch between.
In all of the above, type errors should still come through. Note that in the case of type definitions with deriving clauses, like this one:
that one should expect the following in suppress-types mode:
i.e., the derived value declarations should come through, but not the types.
I propose that module declarations make it through in suppress-types mode, even if those modules contain only types.
Note that something close to the "suppress all" behavior is available by dropping the # syntax. But it would be good to have this control while still keeping the basic syntax. Indeed, in suppress types mode, it would be useful to have some lines that are type definitions and some that are value declarations in the same block, and have their behavior vary as suggested above.
The text was updated successfully, but these errors were encountered: