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 {
|
2022-06-23 18:38:07 +00:00
|
|
|
| InternalExpressionValue.IEvModule(nameSpace) =>
|
2022-06-16 12:08:59 +00:00
|
|
|
Module.removeOther(
|
|
|
|
nameSpace,
|
|
|
|
ReducerInterface.StdLib.internalStdLib,
|
2022-06-23 18:38:07 +00:00
|
|
|
)->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)
|