View Source Guesswork.Answer.Computation (Guesswork v0.4.4)
Represents some arbitrary computation that can be bound to a variable or used to verify correctness.
Summary
Functions
Checks the environment for the inputs, and then runs the stored functions. If the inputs are not present or not concrete values, an error is returned.
Types
@type error() :: {:error, {:unbound | :bound_to_var, Guesswork.Ast.Variable.t()}}
@type func() :: (... -> Guesswork.Ast.Term.entity())
@type t() :: %Guesswork.Answer.Computation{ func: func(), inputs: Guesswork.Ast.Term.entity() | Guesswork.Ast.Variable.t() }
Functions
@spec new([Guesswork.Ast.Variable.t() | Guesswork.Ast.Term.t()], func()) :: t()
@spec run(t(), Guesswork.Ast.Statement.env()) :: {:ok, Guesswork.Ast.Term.entity()} | error()
Checks the environment for the inputs, and then runs the stored functions. If the inputs are not present or not concrete values, an error is returned.