package ocamlformat
Build not yet checked sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Auto-formatter for OCaml code
Install
dune-project
Dependency
Authors
Maintainers
Sources
ocamlformat-0.30.0.tbz
sha256=586a5cc2f4aa5949d2059189eb2dd25d3505fc9224f4b07b994ca819ec640de4
sha512=141612346985dd3de57a2aa3db28d20230d3e612c42ea2ca6e0cb7713de15009bc362843de4511b8a95590d7a2dbab35ba659cb8d44cdf1fda79774be8b9cc67
doc/doc_comments.html
Doc-comments language reference
OCamlFormat uses odoc-parser to parse doc-comments (also referred to as doc-strings), and hence it inherits the accepted language from odoc (detailed in odoc's documentation).
Here is an example showing a few useful elements:
(** Adding integers. *)
(** {1 Exception} *)
(** Raised in case of integer overflow *)
exception Int_overflow
(** {1 Function definition} *)
(** [add ~x ~y] returns [x + y] or raises an exception in case of integer overflow.
Usage:
{@ocaml some_metadata[
# add ~x:1 ~y:2 ;;
- : int = 3
]}
Here is a basic diagram:
{v
add ~x:1 ~y:2
\ /
(+)
|
3
v}
Notes:
- {_ check} that exception {!exception:Int_overflow} is {b not raised};
- have a look at {!module:Int}.
@return [x + y]
@raise Exception [Int_overflow] *)
val add: x:int (** one operand *) -> y:int (** another operand *) -> int (** result *)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>