Formula (formula v0.1.7)

Documentation for Formula.

Link to this section Summary

Functions

Evaluate a given map that contains function

Evaluate the formula given the data

Return the fields for a given formula

Parse a given map into functions and symbols

Parse a formula.

Link to this section Functions

@spec evaluate(map()) :: map() | {:error, term()}

Evaluate a given map that contains function

Link to this function

evaluate(data, formula)

@spec evaluate(map(), String.t()) :: term() | {:error, term()}

Evaluate the formula given the data

Link to this function

get_fields(formula)

@spec get_fields(String.t()) :: [String.t()] | {:error, term()}

Return the fields for a given formula

@spec parse(map()) :: map() | {:error, term()}

Parse a given map into functions and symbols

Link to this function

parse_formula(string)

@spec parse_formula(String.t()) ::
  Formula.Function.t() | {:error, Formula.Errors.InvalidFormulaError.t()}

Parse a formula.

Return a function struct if it is valid. Return error otherwise.

Link to this function

parse_formula(string, key)

@spec parse_formula(String.t(), String.t()) ::
  Formula.Function.t() | {:error, Formula.Errors.InvalidFormulaError.t()}