Search documentation of Metastatic

# Metastatic.Analysis.Purity.Effects (Metastatic v0.2.0)

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

## Types

effect()

## Functions

detect(ast)

Detects effects in a MetaAST node.

# Types

# effect()

    @type effect() :: Metastatic.Analysis.Purity.Result.effect()

# Functions

# detect(ast)

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

Detects effects in a MetaAST node.

Returns a list of detected effects.

## Examples

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

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