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-24 10:15:38 +00:00
|
|
|
let removeDefaultsInternal = (iev: InternalExpressionValue.t) => {
|
2022-06-16 12:08:59 +00:00
|
|
|
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-24 10:15:38 +00:00
|
|
|
let removeDefaultsExternal = (ev: ExternalExpressionValue.t): ExternalExpressionValue.t =>
|
2022-06-16 12:08:59 +00:00
|
|
|
ev->InternalExpressionValue.toInternal->removeDefaultsInternal->InternalExpressionValue.toExternal
|
|
|
|
|
|
|
|
let rRemoveDefaultsInternal = r => Belt.Result.map(r, removeDefaultsInternal)
|
|
|
|
let rRemoveDefaultsExternal = r => Belt.Result.map(r, removeDefaultsExternal)
|