Metastatic.Analysis.Purity.Effects (Metastatic v0.10.4)

View Source

Detects side effects in MetaAST nodes.

Identifies impure operations including I/O, mutations, random operations, time operations, network/database access, and exception handling.

Summary

Functions

Detects effects in a MetaAST node.

Types

effect()

Functions

detect(ast)

@spec detect(Metastatic.AST.meta_ast()) :: [effect()]

Detects effects in a MetaAST node.

Returns a list of detected effects.

3-Tuple Format

All MetaAST nodes use the uniform 3-tuple structure: {type_atom, keyword_meta, children_or_value}

Examples

iex> Metastatic.Analysis.Purity.Effects.detect({:function_call, [name: "print"], []})
[:io]

iex> Metastatic.Analysis.Purity.Effects.detect({:literal, [subtype: :integer], 42})
[]