View Source Formula2 (formula2 v0.1.0)

Summary

Types

@type ast() :: [var_ref() | value()]
@type env() :: %{required(var_ref()) => ([value()] -> value())}
@type value() :: integer() | float()
@type var_ref() :: binary()

Functions

@spec eval(ast(), env()) :: {:ok, value()} | {:error, term()}

Execute the AST over the environment.

@spec parse(binary()) :: ast()

Return the AST for a binary

Link to this function

parse_and_eval(formula, formula_env, options \\ [])

View Source
Link to this function

parse_and_validate(formula, var_names, options \\ [max_runs: 1000])

View Source
Link to this function

validate(ast, env, var_names, options \\ [max_runs: 1000])

View Source

Run property tests against the given