package cmdlang
-
cmdlang.ast
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
A type to represent lists that are statically known to be non-empty.
The way this constructor is defined allows one to use the regular list literal syntax in a context where a non-empty list is expected. For example, the function Arg.flag
expects a first argument of type string Nonempty_list.t
and may be used that way:
Arg.flag [ "verbose" ] ~doc:"enable more output"
The point being that the following would be a type error:
Arg.flag [] ~doc:"enable more output"