Typed values
Run the complete example from a checkout:
$ cabal run --verbose=0 typed-valuesProgram output:
("3.3a","@17",120)The program parses supplied text and constructs values. Its only IO prints
the result; it neither inspects an installed tmux binary nor contacts a server.
IDs and indices describe different things¶
SessionId, WindowId and PaneId are distinct types. Their parsers require
the corresponding $, @ or % prefix, canonical decimal spelling and the
native unsigned 32-bit range. Leading zeroes and whitespace are rejected.
Use the rendering functions when producing external target text.
An ID alone carries no endpoint or server lifetime. Parsing @17 does not
prove that a window exists. The ID API does not yet provide generation-bound
references for external operations.
WindowIndex identifies a window link’s position within a session.
PaneIndex identifies a pane’s position within its window. Neither is an
entity ID. A physical window may have several links, including multiple
indices in the same session.
Validate values where they enter the program¶
Constructors return Either: dimensions must be positive; indices must be
nonnegative. Their numeric accessors return Integer, so reading a value
does not narrow it to a machine-sized integer.
mkDimension checks the mathematical domain. A particular tmux command can
impose a smaller numeric range; successful construction does not establish
that command’s capability or maximum.
Release admission has a limited meaning¶
parseVersion accepts stable releases and the output format of tmux -V,
including one final LF. Development versions and trailing data are rejected.
requireSupported admits the inclusive range from
tmux 3.3a through 3.8. Intermediate releases are supported; CI tests the endpoints.
These functions validate the supplied release identity. They do not inspect the host or qualify all features of that release. See implementation status for the boundary between the exposed package and the transport work.
The API guide links the public modules and their error types.