2022-03-29 09:09:59 +00:00
|
|
|
module ErrorValue = Reducer_ErrorValue
|
|
|
|
module Expression = Reducer_Expression
|
2022-04-11 01:18:38 +00:00
|
|
|
|
2022-04-27 20:24:06 +00:00
|
|
|
@genType
|
2022-06-24 10:15:38 +00:00
|
|
|
type environment = ReducerInterface_ExternalExpressionValue.environment
|
2022-04-27 20:24:06 +00:00
|
|
|
@genType
|
2022-04-27 20:00:42 +00:00
|
|
|
type errorValue = Reducer_ErrorValue.errorValue
|
2022-04-27 20:24:06 +00:00
|
|
|
@genType
|
2022-06-24 10:15:38 +00:00
|
|
|
type expressionValue = ReducerInterface_ExternalExpressionValue.t
|
2022-04-27 20:24:06 +00:00
|
|
|
@genType
|
2022-06-24 10:15:38 +00:00
|
|
|
type externalBindings = ReducerInterface_ExternalExpressionValue.externalBindings
|
2022-05-04 18:44:46 +00:00
|
|
|
@genType
|
2022-06-24 10:15:38 +00:00
|
|
|
type lambdaValue = ReducerInterface_ExternalExpressionValue.lambdaValue
|
2022-05-04 18:44:46 +00:00
|
|
|
|
2022-04-27 20:24:06 +00:00
|
|
|
@genType
|
2022-04-27 20:00:42 +00:00
|
|
|
let evaluateUsingOptions: (
|
2022-06-24 10:15:38 +00:00
|
|
|
~environment: option<QuriSquiggleLang.ReducerInterface_ExternalExpressionValue.environment>,
|
|
|
|
~externalBindings: option<
|
|
|
|
QuriSquiggleLang.ReducerInterface_ExternalExpressionValue.externalBindings,
|
|
|
|
>,
|
2022-04-17 17:24:39 +00:00
|
|
|
string,
|
2022-04-27 20:00:42 +00:00
|
|
|
) => result<expressionValue, errorValue>
|
2022-04-27 20:24:06 +00:00
|
|
|
@genType
|
2022-04-29 17:03:58 +00:00
|
|
|
let evaluatePartialUsingExternalBindings: (
|
|
|
|
string,
|
2022-06-24 10:15:38 +00:00
|
|
|
QuriSquiggleLang.ReducerInterface_ExternalExpressionValue.externalBindings,
|
|
|
|
QuriSquiggleLang.ReducerInterface_ExternalExpressionValue.environment,
|
2022-04-29 17:03:58 +00:00
|
|
|
) => result<externalBindings, errorValue>
|
|
|
|
@genType
|
2022-04-27 20:00:42 +00:00
|
|
|
let evaluate: string => result<expressionValue, errorValue>
|
|
|
|
|
|
|
|
let parse: string => result<Expression.expression, errorValue>
|
2022-05-04 18:44:46 +00:00
|
|
|
|
|
|
|
@genType
|
|
|
|
let foreignFunctionInterface: (
|
2022-06-24 10:15:38 +00:00
|
|
|
QuriSquiggleLang.ReducerInterface_ExternalExpressionValue.lambdaValue,
|
|
|
|
array<QuriSquiggleLang.ReducerInterface_ExternalExpressionValue.t>,
|
|
|
|
QuriSquiggleLang.ReducerInterface_ExternalExpressionValue.environment,
|
2022-05-04 18:44:46 +00:00
|
|
|
) => result<expressionValue, errorValue>
|
|
|
|
|
|
|
|
@genType
|
|
|
|
let defaultEnvironment: environment
|
|
|
|
|
|
|
|
@genType
|
|
|
|
let defaultExternalBindings: externalBindings
|