package ocamlformat-mlx-lib
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=6a40faa182faee55f32bc92387b7e7f97818e160e0f4ef0e0032c0b8b70b86d1
sha512=7df487ebdcddff3529886e034fa9d5476c765c60926b11b8d86fb0e42bea3ee41f693c898e7f95bfc19ca9fa0116825c040a3e027c1e3b7505ebe6c6508540ec
doc/ocamlformat-mlx-lib.ocaml_common/Ocamlformat_ocaml_common/Longident/index.html
Module Ocamlformat_ocaml_common.Longident
Source
Long identifiers, used in parsetree.
Warning: this module is unstable and part of compiler-libs.
To print a longident, see Pprintast.longident
, using Format.asprintf
to convert to a string.
For a non-empty list l
, unflatten l
is Some lid
where lid
is the long identifier created by concatenating the elements of l
with Ldot
. unflatten []
is None
.
This function is broken on identifiers that are not just "Word.Word.word"; for example, it returns incorrect results on infix operators and extended module paths.
If you want to generate long identifiers that are a list of dot-separated identifiers, the function unflatten
is safer and faster. unflatten
is available since OCaml 4.06.0.
If you want to parse any identifier correctly, use the long-identifiers functions from the Parse
module, in particular Parse.longident
. They are available since OCaml 4.11, and also provide proper input-location support.