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 6243b380..0fdb890d 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 @@ -91,7 +91,7 @@ let rec reduceExpression = (expression: t, bindings: T.bindings): result (fName, args->Belt.List.toArray)->BuiltIn.dispatch // "(lambda(x=>internal) param)" - | list{EvLambda(parameters, internal), ...args} => + | list{EvLambda((parameters, internal)), ...args} => applyParametersToLambda(internal, parameters, args) | _ => valueList->Belt.List.toArray->ExpressionValue.EvArray->Ok } @@ -121,7 +121,7 @@ let rec reduceExpression = (expression: t, bindings: T.bindings): result => switch expression { | T.EList(list{T.EValue(EvCall("$lambda")), T.EParameters(parameters), functionDefinition}) => - EvLambda(parameters, functionDefinition->castExpressionToInternalCode)->Ok + EvLambda((parameters, functionDefinition->castExpressionToInternalCode))->Ok | T.EValue(value) => value->Ok | T.EList(list) => { let racc: result, 'e> = list->Belt.List.reduceReverse(Ok(list{}), ( diff --git a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExpressionValue.res b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExpressionValue.res index 1536be74..2b11a62f 100644 --- a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExpressionValue.res +++ b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExpressionValue.res @@ -14,7 +14,7 @@ type rec expressionValue = | EvBool(bool) | EvCall(string) // External function call | EvDistribution(GenericDist_Types.genericDist) - | EvLambda(array, internalCode) + | EvLambda((array, internalCode)) | EvNumber(float) | EvRecord(Js.Dict.t) | EvString(string) @@ -29,7 +29,7 @@ let rec toString = aValue => switch aValue { | EvBool(aBool) => Js.String.make(aBool) | EvCall(fName) => `:${fName}` - | EvLambda(parameters, _internalCode) => `lambda(${Js.Array2.toString(parameters)}=>internal)` + | EvLambda((parameters, _internalCode)) => `lambda(${Js.Array2.toString(parameters)}=>internal)` | EvNumber(aNumber) => Js.String.make(aNumber) | EvString(aString) => `'${aString}'` | EvSymbol(aString) => `:${aString}` @@ -60,7 +60,7 @@ let toStringWithType = aValue => | EvBool(_) => `Bool::${toString(aValue)}` | EvCall(_) => `Call::${toString(aValue)}` | EvDistribution(_) => `Distribution::${toString(aValue)}` - | EvLambda(_parameters, _internalCode) => `Lambda::${toString(aValue)}` + | EvLambda((_parameters, _internalCode)) => `Lambda::${toString(aValue)}` | EvNumber(_) => `Number::${toString(aValue)}` | EvRecord(_) => `Record::${toString(aValue)}` | EvString(_) => `String::${toString(aValue)}`