squiggle/packages/squiggle-lang/src/rescript/Reducer/Reducer.res

28 lines
1.1 KiB
Plaintext
Raw Normal View History

2022-03-29 09:09:59 +00:00
module ErrorValue = Reducer_ErrorValue
module Expression = Reducer_Expression
2022-05-04 18:44:46 +00:00
module ExpressionValue = ReducerInterface_ExpressionValue
module Lambda = Reducer_Expression_Lambda
2022-03-24 12:41:31 +00:00
type environment = ReducerInterface_ExpressionValue.environment
type errorValue = Reducer_ErrorValue.errorValue
2022-04-23 13:40:04 +00:00
type expressionValue = ReducerInterface_ExpressionValue.expressionValue
type externalBindings = ReducerInterface_ExpressionValue.externalBindings
2022-05-04 18:44:46 +00:00
type lambdaValue = ExpressionValue.lambdaValue
let evaluate = Expression.evaluate
let evaluateUsingOptions = Expression.evaluateUsingOptions
let evaluatePartialUsingExternalBindings = Expression.evaluatePartialUsingExternalBindings
2022-03-29 09:09:59 +00:00
let parse = Expression.parse
2022-05-04 18:44:46 +00:00
let foreignFunctionInterface = (
lambdaValue: lambdaValue,
argArray: array<expressionValue>,
environment: ExpressionValue.environment,
) => {
2022-05-04 20:54:18 +00:00
Lambda.foreignFunctionInterface(lambdaValue, argArray, environment, Expression.reduceExpression)
2022-05-04 18:44:46 +00:00
}
let defaultEnvironment = ExpressionValue.defaultEnvironment
let defaultExternalBindings = ExpressionValue.defaultExternalBindings