Skip to main content

haskell_expr

Macro haskell_expr 

Source
haskell_expr!() { /* proc-macro */ }
Expand description

Embeds a Haskell Core expression and its DataConTable without evaluating.

Unlike haskell_eval!, this macro does NOT evaluate the expression. It returns (CoreExpr, DataConTable) — suitable for effect-driven execution via EffectMachine where the caller controls evaluation.

Accepts the same path formats as haskell_eval!:

  • .cbor path (pre-compiled CBOR, requires a sibling meta.cbor)
  • .hs path (compiled on-demand via nix run .#tidepool-extract)
  • .hs::binding syntax for multi-binding modules

§Returns

Returns (tidepool_repr::CoreExpr, tidepool_repr::DataConTable).

§Examples

let (expr, table) = haskell_expr!("../Guess.hs::game");
let mut heap = tidepool_eval::heap::VecHeap::new();
let mut machine = tidepool_effect::EffectMachine::new(&table, &mut heap).unwrap();