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
|
2022-07-18 14:11:10 +00:00
|
|
|
module Bindings = Reducer_Bindings
|
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-07-18 14:11:10 +00:00
|
|
|
| InternalExpressionValue.IEvBindings(nameSpace) =>
|
|
|
|
Bindings.removeOther(
|
2022-06-16 12:08:59 +00:00
|
|
|
nameSpace,
|
|
|
|
ReducerInterface.StdLib.internalStdLib,
|
2022-07-18 14:11:10 +00:00
|
|
|
)->InternalExpressionValue.IEvBindings
|
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)
|