include "./Environment" importJava "org.simantics.scl.compiler.top.ExpressionEvaluator" where data ExpressionEvaluator @JavaName "" createExpressionEvaluator :: RuntimeEnvironment -> String -> ExpressionEvaluator eval :: ExpressionEvaluator -> a expectedType :: ExpressionEvaluator -> Type -> ExpressionEvaluator importJava "org.simantics.scl.compiler.top.SCLExpressionCompilationException" where data SCLExpressionCompilationException data EvaluationModifier applyModifier evaluator _ = () evaluateExpression :: Typeable a => RuntimeEnvironment -> [EvaluationModifier] -> String -> a evaluateExpression runtimeEnvironment modifiers expression = do evaluator = createExpressionEvaluator runtimeEnvironment expression expectedType evaluator (typeOfProxy (TypeProxy :: TypeProxy a)) iter (applyModifier evaluator) modifiers eval evaluator untypedEvaluateExpression :: RuntimeEnvironment -> [EvaluationModifier] -> String -> a untypedEvaluateExpression runtimeEnvironment modifiers expression = do evaluator = createExpressionEvaluator runtimeEnvironment expression iter (applyModifier evaluator) modifiers eval evaluator