diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_TestHelpers.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_TestHelpers.res index 9a0e5436..0790c078 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_TestHelpers.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_TestHelpers.res @@ -24,7 +24,7 @@ let expectEvalPartialBindingsToBe = ( bindings: Reducer.externalBindings, answer: string, ) => - Reducer.evaluatePartialWBindings(expr, bindings) + Reducer.evaluatePartialUsingExternalBindings(expr, bindings) ->ExpressionValue.toStringResultRecord ->expect ->toBe(answer) diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer.res index 063d36c4..d2e4858f 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer.res @@ -9,7 +9,7 @@ type expressionValue = Reducer_Expression.expressionValue type externalBindings = Expression.externalBindings let evaluate = Expression.eval let evaluateUsingExternalBindings = Expression.evalUsingExternalBindings -let evaluatePartialWBindings = Expression.evalPartialWBindings +let evaluatePartialUsingExternalBindings = Expression.evalPartialUsingExternalBindings let parse = Expression.parse let parseOuter = Expression.parseOuter let parsePartial = Expression.parsePartial diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer.resi b/packages/squiggle-lang/src/rescript/Reducer/Reducer.resi index fe1da462..8bbfc0b5 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer.resi +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer.resi @@ -17,7 +17,7 @@ let evaluateUsingExternalBindings: ( externalBindings, ) => result @genType -let evaluatePartialWBindings: ( +let evaluatePartialUsingExternalBindings: ( 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 bf22df71..68881496 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 @@ -124,7 +124,7 @@ let evalUsingExternalBindingsExpression_ = (aExpression, bindings): result { +let evalPartialUsingExternalBindings_ = (codeText: string, bindings: T.bindings) => { parsePartial(codeText)->Result.flatMap(expression => expression->evalUsingExternalBindingsExpression_(bindings) ) @@ -169,12 +169,12 @@ let evalUsingExternalBindings = (code: string, externalBindings: externalBinding Evaluates code with external bindings. External bindings are a record of expression values. The code is a partial code as if it is cut from a larger code. Therefore all statments are assignments. */ -let evalPartialWBindings = (code: string, externalBindings: externalBindings): result< +let evalPartialUsingExternalBindings = (code: string, externalBindings: externalBindings): result< externalBindings, 'e, > => { let bindings = externalBindings->externalBindingsToBindings - let answer = evalPartialWBindings_(code, bindings) + let answer = evalPartialUsingExternalBindings_(code, bindings) answer->Result.flatMap(answer => switch answer { | EvRecord(aRecord) => Ok(aRecord)