This module manages the context that an expression runs with. Specifically it is used to assign values to constants, and set functions that can be called from the expression.
context : Context
context =
Context.empty
|> Context.addConstant "x" 5
|> Context.addFunction "stringToInt" stringToInt
Eexl.evaluateInt context """x + 5 + stringToInt("7")""" -- = Ok 17Add a constant to the context.
Add a function to the context.
Retrieve a constant from the context (not usually used).
Retrieve a constant from the context (not usually used).
This is the type of
Contextthat is passed into the functions that evaluate expressions.