Official Packages
The Whim project maintains Trifle packages on Codeberg. They live outside the main Whim repository and do not ship with the standard library.
These packages use names under Trifle\. Their Git tags define their
versions. Install them through Whim’s Git package manager.
| Package | Description | Install |
|---|---|---|
ansi | ANSI colours, styles, cursor movement, and screen controls. | whim add git+ssh://[email protected]/trifle/ansi |
args | Typed command-line parsing and generated usage. | whim add git+ssh://[email protected]/trifle/args |
cache | Stampede-safe local LRU and database caches. | whim add git+ssh://[email protected]/trifle/cache |
clock | Clocks and sleep that tests can control. | whim add git+ssh://[email protected]/trifle/clock |
config | Typed configuration from values, files, and the environment. | whim add git+ssh://[email protected]/trifle/config |
console | Terminal output, tables, progress, and prompts. | whim add git+ssh://[email protected]/trifle/console |
cqrs | Command and query buses with events, logs, and traces. | whim add git+ssh://[email protected]/trifle/cqrs |
cron | Cron expression parsing and occurrence calculation. | whim add git+ssh://[email protected]/trifle/cron |
diff | Myers diffs for values and text, with unified output. | whim add git+ssh://[email protected]/trifle/diff |
dotenv | .env parsing and environment layering. | whim add git+ssh://[email protected]/trifle/dotenv |
event | Typed events with hierarchy-aware listeners. | whim add git+ssh://[email protected]/trifle/event |
expect | Fluent expectations for tests. | whim add git+ssh://[email protected]/trifle/expect |
fake | Deterministic fake data generated from a seed. | whim add git+ssh://[email protected]/trifle/fake |
feed | Atom and RSS feed generation. | whim add git+ssh://[email protected]/trifle/feed |
fn | Small combinators for building transforms. | whim add git+ssh://[email protected]/trifle/fn |
fuse | A circuit breaker with controllable time. | whim add git+ssh://[email protected]/trifle/fuse |
graph | Immutable graphs with traversal and shortest paths. | whim add git+ssh://[email protected]/trifle/graph |
humanize | Human-readable durations, sizes, counts, and numbers. | whim add git+ssh://[email protected]/trifle/humanize |
lock | Leased mutual exclusion over pluggable stores. | whim add git+ssh://[email protected]/trifle/lock |
log | Structured logging with composable loggers. | whim add git+ssh://[email protected]/trifle/log |
markdown | CommonMark and GitHub-flavoured Markdown parsing. | whim add git+ssh://[email protected]/trifle/markdown |
markdown-ansi | Markdown rendering for styled terminal text. | whim add git+ssh://[email protected]/trifle/markdown-ansi |
markdown-html | Markdown rendering for HTML. | whim add git+ssh://[email protected]/trifle/markdown-html |
money | Integer money, ISO 4217 currencies, and lossless allocation. | whim add git+ssh://[email protected]/trifle/money |
otp | HOTP, TOTP, and authenticator provisioning. | whim add git+ssh://[email protected]/trifle/otp |
qr | QR code generation with matrix and SVG output. | whim add git+ssh://[email protected]/trifle/qr |
queue | Message queues with retries, workers, and pluggable stores. | whim add git+ssh://[email protected]/trifle/queue |
retry | Retry policies with delays, jitter, deadlines, and controllable time. | whim add git+ssh://[email protected]/trifle/retry |
seal | Sealed payloads and signed JWTs with key rotation. | whim add git+ssh://[email protected]/trifle/seal |
semver | Semantic versions and Cargo-style requirements. | whim add git+ssh://[email protected]/trifle/semver |
sse | Server-sent event encoding and HTTP response bodies. | whim add git+ssh://[email protected]/trifle/sse |
state | Typed finite state machines. | whim add git+ssh://[email protected]/trifle/state |
template | Logic-less Mustache templates rendered from JSON values. | whim add git+ssh://[email protected]/trifle/template |
theme | Paints and themes for terminal text. | whim add git+ssh://[email protected]/trifle/theme |
throttle | Keyed token-bucket and fixed-window rate limits. | whim add git+ssh://[email protected]/trifle/throttle |
trace | Timed spans recorded through structured logs. | whim add git+ssh://[email protected]/trifle/trace |
tree | Immutable trees with traversal, search, and folds. | whim add git+ssh://[email protected]/trifle/tree |
Codeberg hosts all Trifle package repositories.
After you add Trifle\Diff and load vendor/autoload.whim, you can compare two
sequences:
use Trifle\Diff;
use Trifle\Diff\Operation;
$edits = Diff\diff::<string>(vec['a', 'b', 'c'], vec['a', 'c', 'd']);
foreach ($edits as $edit) {
$marker = match ($edit->operation) {
Operation::Keep => ' ',
Operation::Delete => '-',
Operation::Insert => '+',
};
write_line!($marker . ' ' . $edit->value);
}
See Git Dependencies for manifests, locks, updates, and autoloading.