GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Longident(3) OCaml library Longident(3)

Longident - Long identifiers, used in parsetree.

Module Longident

Module Longident
: sig end

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.

type t =
| Lident of string
| Ldot of t * string
| Lapply of t * t

val flatten : t -> string list

val unflatten : string list -> t option

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 .

val last : t -> string

val parse : string -> t

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 Longident.unflatten is safer and faster. Longident.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.

2025-07-03 OCamldoc

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.