# Examples

Source: https://libtmux.org/en/haskell/latest/examples/

> Run the tested Haskell programs, offline or against a private tmux server, and compare each with its expected output.

The repository ships six programs under [`examples/`](<https://github.com/libtmux/libtmux-haskell/tree/663e212622a02aa74a9bdc8ff71e2b45fcb1d4d5/examples>), each its own Cabal
package with a file of expected output. Run one from the repository root, for
example `cabal run --verbose=0 typed-values`. The programs that capture or
rename take the socket of the README's private demonstration server and a
`tmux` binary; `mutate-graph` changes the server you give it. The first two
programs open no socket and need no tmux server.

| Program | What it demonstrates | Guide |
| --- | --- | --- |
| [typed-values](https://github.com/libtmux/libtmux-haskell/blob/663e212622a02aa74a9bdc8ff71e2b45fcb1d4d5/examples/typed-values/Main.hs) | Parse a window ID and a supported tmux release, construct a checked dimension and print them. Opens no socket and starts no process. | [Typed values](https://libtmux.org/en/haskell/latest/guides/typed-values/) |
| [offline-graph](https://github.com/libtmux/libtmux-haskell/blob/663e212622a02aa74a9bdc8ff71e2b45fcb1d4d5/examples/offline-graph/Main.hs) | Build a validated fixture and select active panes by width. A repeated window link shows physical entities against contextual appearances. Opens no socket. | [Offline fixtures](https://libtmux.org/en/haskell/latest/guides/offline-fixtures/) |
| [capture-graph](https://github.com/libtmux/libtmux-haskell/blob/663e212622a02aa74a9bdc8ff71e2b45fcb1d4d5/examples/capture-graph/Main.hs) | Capture a running server, close its handle, then filter detached panes and follow session-to-window links. | [Capture and navigate](https://libtmux.org/en/haskell/latest/guides/capture/) |
| [query-graph](https://github.com/libtmux/libtmux-haskell/blob/663e212622a02aa74a9bdc8ff71e2b45fcb1d4d5/examples/query-graph/Main.hs) | Compare a typed query with an ordinary pane predicate, traverse relationships and check cardinality. | [Typed queries](https://libtmux.org/en/haskell/latest/guides/query/) |
| [shared-runtime](https://github.com/libtmux/libtmux-haskell/blob/663e212622a02aa74a9bdc8ff71e2b45fcb1d4d5/examples/shared-runtime/Main.hs) | Open independent Server scopes under one Runtime, close one handle and capture through the other. | [Shared Runtime scopes](https://libtmux.org/en/haskell/latest/guides/shared-runtime/) |
| [mutate-graph](https://github.com/libtmux/libtmux-haskell/blob/663e212622a02aa74a9bdc8ff71e2b45fcb1d4d5/examples/mutate-graph/Main.hs) | Rename a session and a window and set a pane title through captured references, then capture again. The earlier snapshot keeps its old values. | [Rename and set pane titles](https://libtmux.org/en/haskell/latest/guides/mutations/) |
