eval/context

Functions

pub fn get() -> Eval(a, b, a)

Get the current context.

pub fn modify(f: fn(a) -> a) -> Eval(Nil, b, a)

Update the current context by applying a function to it.

pub fn set(ctx: a) -> Eval(Nil, b, a)

Replace the current context with a new fixed value.

pub fn then_set(eval: Eval(a, b, c), ctx: c) -> Eval(a, b, c)

Run an Eval step and then replace the resulting context with a new fixed value.

pub fn update(eval: Eval(a, b, c), f: fn(c, a) -> c) -> Eval(
  a,
  b,
  c,
)