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
When defining module in an interactive session, OCaml tends to print the full expended signature:
#moduleM=Map.Make(Int);;
moduleM :
sig(* Insert >50 lines here *)end
Having this in your readme or documentation is basically never desired behavior. Having a way to shorten it or use named modules would be nice:
option one: allow a abbreviated version (perhaps with a simple label to toggle on off).
With this option, this should not generate any error:
<!-- $MDX abbrev -->```ocaml# module M = Map.Make(Int);;module M : sig ... end ```
option two: allow subtyping (probably much harder to do).
with this option this should also check that M can be given the supplied type
<!-- $MDX module-subtypes -->```ocaml# module M = Map.Make(Int);;module M <: Map.S with type key = int```
(a common hack to check this it to add a module _ : Map.S with type key = int = M after the definition of M).
I should mention that there is a way to avoid this problem: using non-toplevel code blocks (one that don't start with #), since they don't produce any output. (Also, maybe mention these exist in the readme? Finding them took a while...).
```ocamlmodule M = Map.Make(Int)```
However, it means you sometimes have to alternate code blocks frequently between toplevel/non-toplevel, which can be annoying and look a bit weird in the output.
The text was updated successfully, but these errors were encountered:
Maybe related to #282.
When defining module in an interactive session, OCaml tends to print the full expended signature:
Having this in your readme or documentation is basically never desired behavior. Having a way to shorten it or use named modules would be nice:
option one: allow a abbreviated version (perhaps with a simple label to toggle on off).
With this option, this should not generate any error:
option two: allow subtyping (probably much harder to do).
with this option this should also check that
M
can be given the supplied type(a common hack to check this it to add a
module _ : Map.S with type key = int = M
after the definition ofM
).I should mention that there is a way to avoid this problem: using non-toplevel code blocks (one that don't start with
#
), since they don't produce any output. (Also, maybe mention these exist in the readme? Finding them took a while...).However, it means you sometimes have to alternate code blocks frequently between toplevel/non-toplevel, which can be annoying and look a bit weird in the output.
The text was updated successfully, but these errors were encountered: