Metastatic.Adapters.Haskell.Subprocess (Metastatic v0.10.4)

View Source

Manages subprocess communication with the Haskell parser.

Uses Stack to execute the parser binary built from priv/parsers/haskell/.

Summary

Functions

Parse Haskell source code by invoking the Stack-based parser subprocess.

Functions

parse(source)

@spec parse(String.t()) :: {:ok, map()} | {:error, String.t()}

Parse Haskell source code by invoking the Stack-based parser subprocess.

Returns {:ok, ast} on success or {:error, reason} on failure.

Examples

iex> Metastatic.Adapters.Haskell.Subprocess.parse("1 + 2")
{:ok, %{"type" => "infix", ...}}