Continuum.Pure (continuum v0.5.0)

Copy Markdown View Source

Mark a module as a pure helper that may be called from workflow code.

The Continuum.AstCheck scanner runs over every function in the module as it is defined; non-deterministic calls become compile errors.

defmodule MyApp.PriceMath do
  use Continuum.Pure

  def total(items), do: Enum.reduce(items, 0, & &1.price + &2)
end

Trusted stdlib modules (Enum, Map, String, …) do not need this; see Continuum.AstCheck.trusted_stdlib/0 for the baked-in allowlist.