View Source Permit.Operators.GenOperator behaviour (permit v0.1.0)

Generic operator behaviour. For each operator, it allows defining:

  • the main symbol (e.g. :==)
  • alternative and equivalent symbols (e.g. :eq)
  • semantics function builders, returning functions to determine whether the operator is truthy or falsy.

Part of the private API, subject to changes and not to be used on the application level.

Summary

Types

Callbacks

@callback alternatives() :: [atom()]
@callback semantics(condition_fn()) :: operator_result()
Link to this callback

semantics(condition_fn, keyword)

View Source
@callback semantics(
  condition_fn(),
  keyword()
) :: operator_result()
@callback symbol() :: atom()