diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_test.res index fa6c58f9..81bafd97 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_test.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_test.res @@ -217,8 +217,4 @@ describe("Peggy to Expression", () => { (), ) }) - - describe("unit", () => { - testToExpression("1m", "(:$$_block_$$ (:multiply 1 (:$valueOfUnit 'm')))", ~v="1", ()) - }) }) diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res index 1ab8d559..141b4a37 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res @@ -129,23 +129,6 @@ let callInternal = (call: functionCall, environment, reducer: ExpressionT.reduce ) } - let doValueOfUnit = (aUnit: string) => - switch aUnit { - | "nm" => 0.000000001->EvNumber->Ok - | "um" => 0.000001->EvNumber->Ok - | "mm" => 0.001->EvNumber->Ok - | "cm" => 0.01->EvNumber->Ok - | "dm" => 0.1->EvNumber->Ok - | "m" => 1.->EvNumber->Ok - | "dam" => 10.->EvNumber->Ok - | "hm" => 100.->EvNumber->Ok - | "km" => 1000.->EvNumber->Ok - | "Mm" => 1000000.->EvNumber->Ok - | "Gm" => 1000000000.->EvNumber->Ok - | "Tm" => 1000000000000.->EvNumber->Ok - | _ => REUnitNotFound(aUnit)->Error - } - switch call { | ("$_atIndex_$", [EvArray(aValueArray), EvNumber(fIndex)]) => arrayAtIndex(aValueArray, fIndex) | ("$_atIndex_$", [EvRecord(dict), EvString(sIndex)]) => recordAtIndex(dict, sIndex) @@ -154,7 +137,6 @@ let callInternal = (call: functionCall, environment, reducer: ExpressionT.reduce | ("$_exportBindings_$", [EvRecord(externalBindings)]) => doExportBindings(externalBindings) | ("$_setBindings_$", [EvRecord(externalBindings), EvSymbol(symbol), value]) => doSetBindings(externalBindings, symbol, value) - | ("$valueOfUnit", [EvString(aUnit)]) => doValueOfUnit(aUnit) | ("inspect", [value, EvString(label)]) => inspectLabel(value, label) | ("inspect", [value]) => inspect(value) | ("keep", [EvArray(aValueArray), EvLambda(aLambdaValue)]) =>