Loading ...
Sorry, an error occurred while loading the content.

12085Re: "ocaml_beginners"::[] Explicit parameter names in .mli files

Expand Messages
  • Michael Ekstrand
    Aug 5, 2010
    • 0 Attachment
      On Thu, 2010-08-05 at 09:33 +0000, iainmcgin wrote:
      > What I would really like is named parameters, but only for
      > documentation purposes, in .mli files, without these names being
      > treated as labels, which seem to be the main cause of my problems
      > above. Is this possible? If not, through what other means could I
      > document what the intent of each parameter is (i.e. ocamldoc
      > annotations, etc)?

      The standard library accomplishes this via ocamldoc. So, there would be
      a definition in the mli like this:

      val f: string -> string -> string
      (** [f x y] frobnicates x and y, returning the Foo transform *)

      I find that to be quite readable in most cases.

      - Michael
    • Show all 5 messages in this topic