diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_TestHelpers.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_TestHelpers.res index 74c196f2..9a0e5436 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_TestHelpers.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_TestHelpers.res @@ -17,7 +17,7 @@ let expectEvalToBe = (expr: string, answer: string) => Reducer.evaluate(expr)->ExpressionValue.toStringResult->expect->toBe(answer) let expectEvalBindingsToBe = (expr: string, bindings: Reducer.externalBindings, answer: string) => - Reducer.evaluateWBindings(expr, bindings)->ExpressionValue.toStringResult->expect->toBe(answer) + Reducer.evaluateUsingExternalBindings(expr, bindings)->ExpressionValue.toStringResult->expect->toBe(answer) let expectEvalPartialBindingsToBe = ( expr: string, diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer.res index 5673988e..063d36c4 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer.res @@ -8,7 +8,7 @@ module MathJs = Reducer_MathJs type expressionValue = Reducer_Expression.expressionValue type externalBindings = Expression.externalBindings let evaluate = Expression.eval -let evaluateWBindings = Expression.evalWBindings +let evaluateUsingExternalBindings = Expression.evalUsingExternalBindings let evaluatePartialWBindings = Expression.evalPartialWBindings let parse = Expression.parse let parseOuter = Expression.parseOuter diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer.resi b/packages/squiggle-lang/src/rescript/Reducer/Reducer.resi index 51cc9894..fe1da462 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer.resi +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer.resi @@ -12,7 +12,7 @@ type externalBindings = ReducerInterface_ExpressionValue.externalBindings @genType let evaluate: string => result @genType -let evaluateWBindings: ( +let evaluateUsingExternalBindings: ( string, externalBindings, ) => result diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Expression/Reducer_Expression.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Expression/Reducer_Expression.res index 0b6e3681..bf22df71 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Expression/Reducer_Expression.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Expression/Reducer_Expression.res @@ -116,7 +116,7 @@ let rec reduceExpression = (expression: t, bindings: T.bindings): result => +let evalUsingExternalBindingsExpression_ = (aExpression, bindings): result => reduceExpression(aExpression, bindings) /* @@ -126,7 +126,7 @@ let evalWBindingsExpression_ = (aExpression, bindings): result { parsePartial(codeText)->Result.flatMap(expression => - expression->evalWBindingsExpression_(bindings) + expression->evalUsingExternalBindingsExpression_(bindings) ) } @@ -136,7 +136,7 @@ let evalPartialWBindings_ = (codeText: string, bindings: T.bindings) => { Therefore all statments are assignments. */ let evalOuterWBindings_ = (codeText: string, bindings: T.bindings) => { - parseOuter(codeText)->Result.flatMap(expression => expression->evalWBindingsExpression_(bindings)) + parseOuter(codeText)->Result.flatMap(expression => expression->evalUsingExternalBindingsExpression_(bindings)) } /* @@ -144,7 +144,7 @@ let evalOuterWBindings_ = (codeText: string, bindings: T.bindings) => { */ let eval = (codeText: string) => { parse(codeText)->Result.flatMap(expression => - expression->evalWBindingsExpression_(defaultBindings) + expression->evalUsingExternalBindingsExpression_(defaultBindings) ) } @@ -160,7 +160,7 @@ let externalBindingsToBindings = (externalBindings: externalBindings): T.binding /* Evaluates code with external bindings. External bindings are a record of expression values. */ -let evalWBindings = (code: string, externalBindings: externalBindings) => { +let evalUsingExternalBindings = (code: string, externalBindings: externalBindings) => { let bindings = externalBindings->externalBindingsToBindings evalOuterWBindings_(code, bindings) }