HORIZON HASKELLDocslts/ghc-10.0.xaa25b892026-10-10Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · aa25b89 · 2026-10-10

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.

  • 1 type
  • 1 value
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.

valuewrapBindings :: Bindings -> String -> String
#

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.