2022-06-16 12:08:59 +00:00
|
|
|
// Reducer_Helpers
|
2022-06-10 12:38:31 +00:00
|
|
|
module ErrorValue = Reducer_ErrorValue
|
2022-06-16 12:08:59 +00:00
|
|
|
module ExternalExpressionValue = ReducerInterface.ExternalExpressionValue
|
|
|
|
module InternalExpressionValue = ReducerInterface.InternalExpressionValue
|
|
|
|
module Module = Reducer_Category_Module
|
2022-06-10 12:38:31 +00:00
|
|
|
|
2022-06-16 12:08:59 +00:00
|
|
|
let removeDefaultsInternal = (iev: InternalExpressionValue.expressionValue) => {
|
|
|
|
switch iev {
|
|
|
|
| InternalExpressionValue.IevModule(nameSpace) =>
|
|
|
|
Module.removeOther(
|
|
|
|
nameSpace,
|
|
|
|
ReducerInterface.StdLib.internalStdLib,
|
|
|
|
)->InternalExpressionValue.IevModule
|
2022-06-10 12:38:31 +00:00
|
|
|
| value => value
|
|
|
|
}
|
2022-06-16 12:08:59 +00:00
|
|
|
}
|
2022-06-10 12:38:31 +00:00
|
|
|
|
2022-06-16 12:08:59 +00:00
|
|
|
let removeDefaultsExternal = (
|
|
|
|
ev: ExternalExpressionValue.expressionValue,
|
|
|
|
): ExternalExpressionValue.expressionValue =>
|
|
|
|
ev->InternalExpressionValue.toInternal->removeDefaultsInternal->InternalExpressionValue.toExternal
|
|
|
|
|
|
|
|
let rRemoveDefaultsInternal = r => Belt.Result.map(r, removeDefaultsInternal)
|
|
|
|
let rRemoveDefaultsExternal = r => Belt.Result.map(r, removeDefaultsExternal)
|