Tour
A guided walk through bang, one concept per page. Every code sample below is a real, gated example from the repo's examples/ corpus — the shown output is read from its expected.txt at build time, so it cannot drift from what bang run actually produces.
This is the v0, no-exec tour: read the code, read the expected output, then run it yourself locally (each lesson has a copy-paste command). An in-browser "edit and run" door is future work, not v0.
- Values are thunks;
$forces — description-vs-value,$(ADR-0007) - Functions & recursion — a generic
let recover your own data, no trait bound - Your own data —
data, constructors, pattern match,deriving - Pattern match: wildcards & mutual recursion — the
_wildcard arm,let rec … and …mutual recursion - State as a library — State is a handler, not a keyword
- Handling an effect —
with, catchingraise - Declare your own effect —
effectdecl,perform, handle end-to-end - Swap the handler, keep the program — the same program under two different handlers
- Identity dispatch (the lexical cap) — why nesting the same effect twice does NOT pick the nearest handler
- Generation as an effect — seeded, replayable nondeterminism — the DST warm-up