package ocamlformat

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
module Format = Format_
val parens_if : Ocamlformat_stdlib.bool -> Conf.t -> ?disambiguate:Ocamlformat_stdlib.bool -> Fmt.t -> Fmt.t
val parens : Conf.t -> ?disambiguate:Ocamlformat_stdlib.bool -> Fmt.t -> Fmt.t
module Exp : sig ... end
val get_or_pattern_sep : ?cmts_before:Ocamlformat_stdlib.bool -> ?space:Ocamlformat_stdlib.bool -> Conf.t -> ctx:Ast.t -> Fmt.t
type cases = {
  1. leading_space : Fmt.t;
  2. bar : Fmt.t;
  3. box_all : Fmt.t -> Fmt.t;
  4. box_pattern_arrow : Fmt.t -> Fmt.t;
  5. break_before_arrow : Fmt.t;
  6. break_after_arrow : Fmt.t;
  7. open_paren_branch : Fmt.t;
  8. break_after_opening_paren : Fmt.t;
  9. close_paren_branch : Fmt.t;
}
val wrap_tuple : Conf.t -> parens:Ocamlformat_stdlib.bool -> no_parens_if_break:Ocamlformat_stdlib.bool -> Fmt.t -> Fmt.t
type record_type = {
  1. docked_before : Fmt.t;
  2. break_before : Fmt.t;
  3. box_record : Fmt.t -> Fmt.t;
  4. box_spaced : Ocamlformat_stdlib.bool;
  5. sep_before : Fmt.t;
  6. sep_after : Fmt.t;
  7. break_after : Fmt.t;
  8. docked_after : Fmt.t;
}
val get_record_type : Conf.t -> record_type
type elements_collection = {
  1. box : Fmt.t -> Fmt.t;
  2. sep_before : Fmt.t;
  3. sep_after_non_final : Fmt.t;
  4. sep_after_final : Fmt.t;
}
type elements_collection_record_expr = {
  1. break_after_with : Fmt.t;
}
type elements_collection_record_pat = {
  1. wildcard : Fmt.t;
}
val get_list_expr : Conf.t -> elements_collection
val get_array_expr : Conf.t -> elements_collection
val get_list_pat : Conf.t -> ctx:Ast.t -> elements_collection
val get_array_pat : Conf.t -> ctx:Ast.t -> elements_collection
type if_then_else = {
  1. box_branch : Fmt.t -> Fmt.t;
  2. cond : Fmt.t;
  3. box_keyword_and_expr : Fmt.t -> Fmt.t;
  4. branch_pro : Fmt.t;
  5. wrap_parens : Fmt.t -> Fmt.t;
  6. expr_pro : Fmt.t Ocamlformat_stdlib.option;
  7. expr_eol : Fmt.t Ocamlformat_stdlib.option;
  8. break_end_branch : Fmt.t;
  9. space_between_branches : Fmt.t;
}
val match_indent : ?default:Ocamlformat_stdlib.int -> Conf.t -> ctx:Ast.t -> Ocamlformat_stdlib.int

match_indent c ~ctx ~default returns the indentation used for the pattern-matching in context ctx, depending on the `match-indent-nested` option, or using the default indentation (0 if not provided) if the option does not apply.

val function_indent : ?default:Ocamlformat_stdlib.int -> Conf.t -> ctx:Ast.t -> Ocamlformat_stdlib.int

function_indent c ~ctx ~default returns the indentation used for the function in context ctx, depending on the `function-indent-nested` option, or using the default indentation (0 if not provided) if the option does not apply.

val comma_sep : Conf.t -> Fmt.s

comma_sep c returns the format string used to separate two elements with a comma, depending on the `break-separators` option.

val semi_sep : Conf.t -> Fmt.s

Like comma_sep but use a semicolon as separator.