Search documentation of Metastatic

# Metastatic.Adapters.Haskell (Metastatic v0.13.2)

View Source

Haskell language adapter for Metastatic.

This adapter provides bidirectional transformation between Haskell source code and MetaAST (M2) representation.

## Architecture

- `parse/1` - Haskell source → Haskell AST (via haskell-src-exts)
- `to_meta/1` - Haskell AST → MetaAST (M2 abstraction)
- `from_meta/2` - MetaAST → Haskell AST (M2 reification)
- `unparse/1` - Haskell AST → Haskell source (via haskell-src-exts)

## Example

    iex> {:ok, ast} = Metastatic.Adapters.Haskell.parse("1 + 2")
    iex> {:ok, meta_ast, _metadata} = Metastatic.Adapters.Haskell.ToMeta.transform(ast)
    iex> meta_ast
    {:binary_op, :arithmetic, :+, {:literal, :integer, 1}, {:literal, :integer, 2}}