package ocamlformat-mlx-lib
Install
Dune Dependency
Authors
Maintainers
Sources
md5=4b32d3b57da54157a0cd8f772094f4bc
sha512=367eeb5d81060a3efb584796cc72cc75d974975bb9b18be6284a86f5937edb90927368fd80e00b3f4c1894e609b4a1503c20d4495c624560243e5055f905390a
doc/ocamlformat-mlx-lib.ocaml_common/Ocaml_common/Longident/index.html
Module 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.