curry.interpreter.eval module
Implements Interpreter.eval.
- curry.interpreter.eval.eval(interp, *args, **kwds)[source]
Evaluate a Curry goal.
- Parameters:
*args – Positional arguments that specify the goal. These are passed to
Interpreter.expr. One function symbol whose scheme has class constraints and no value parameter, a goal without a signature such asmain = Just 5, is applied to its dictionaries first: the constraints are defaulted with the table of the PAKCS REPL (seecurry.typecheck.defaulting), so the goal evaluates to a value and not to a partial application. An expression ofcurry.compile(mode='expr')whose text declaredwhere x freevariables absent from its result type yields its values with the bindings of those variables (curry.typecheck.goals.Bindings).converter – Keyword-only argument specifying the converter to use when returning results. The default is ‘default’, the flag
defaultconverter.'topython'appliescurry.topython(),Noneand any other name leave the Curry value, and a callablef(interp, value)converts as it pleases. See :func:curry.interpreter.conversions.getconverter.exprtype – Keyword-only argument: the type of the goal in Curry syntax, passed to
Interpreter.expr.**kwds – Any other keyword names an anchor, as in
Interpreter.expr.
- Raises:
EvaluationError – A Curry error occurred during evaluation.
CurryTypeError – The table cannot default a class constraint of the goal.
- Returns:
A generator producing the values of the specified Curry program.