Frontier.Classifier (Frontier v0.2.1)

Copy Markdown

Classifies modules by priority: ignored, global, reclassified, context root, schema, exported, internal, or unowned.

Summary

Functions

Classifies a module according to Frontier's priority rules

Returns the owning context for a module, or nil if the module isn't owned by any context.

Types

classification()

@type classification() ::
  :ignored
  | :global
  | :reclassified
  | :context_root
  | :schema
  | :exported
  | :internal
  | :unowned

Functions

classify(module)

@spec classify(module()) :: classification()

Classifies a module according to Frontier's priority rules:

  1. Ignored (per-module or root ignore list)
  2. Global (in root globals list, or submodule of a global)
  3. Reclassified (has belongs_to:)
  4. Context root (has use Frontier)
  5. Schema (defines schema/1)
  6. Exported (listed in context's exports:)
  7. Internal (under a context namespace)
  8. Unowned (not under any context)

owning_context(module)

@spec owning_context(module()) :: module() | nil

Returns the owning context for a module, or nil if the module isn't owned by any context.