Rete.IR.Coll (Rete v0.1.0)

Copy Markdown View Source

A collection binding, e.g. [{:order, id}] or orders = [{:order, id} when amt > 0].

A collection binding is the engine's only accumulator, and it is always collect all. Aggregation is the right hand side's job.

A condition that introduces no new variable propagates [], and the rule fires with zero matches. One that introduces a new variable groups by it, so only non-empty groups exist. :new_bind decides between the two.

Fields are those of Rete.IR.Fact, plus :coll_binding, the variable the collected list binds to. :alpha is applied per element, not to the list.

Summary

Types

t()

@type t() :: %Rete.IR.Coll{
  __ast__: Rete.IR.Fact.ast() | nil,
  alpha: Rete.IR.Expr.t(),
  bind: [atom()],
  coll_binding: atom() | nil,
  inert: [atom()],
  join_bind: [atom()] | nil,
  join_filter: Rete.IR.Expr.t() | nil,
  new_bind: [atom()] | nil,
  type: atom() | module()
}