HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Modulevortex-shell-0.4.1GHC2024

Vortex.Shell.Block

How a session's bindings reach the elaborator: wrapBindings puts them in scope around a block that vortex-elab's blockDo reads.

Synopsis
typetype Bindings = [(String, String)]

Session bindings: a name mapped to one equation of a recursive let spliced into every later block. Two provenances, matching Haskell's own semantics: x <- e evaluates now and captures the show-rendered *value* (effects run once, never replayed); let f x = e (or bare f x = e) captures the *definition* verbatim — so functions bind, and a spell bound by let is a recipe cast anew at each use. Either way the environment is itself Haskell text, like everything else on this wire.

Put the bindings in scope around a block, as one recursive let with explicit braces. The block is read by blockDo first and set on lines of its own, every line indented one column, closing bracket included: the whole wrapper is then one statement to the blockDo the evaluator applies, which leaves it as written. A line of the wrapper at column zero would start a statement of its own there, and GHC would refuse the ; put before it.