AB.TypeFormatter (AB v0.2.1)

View Source

Utilities for formatting and displaying Elixir type specifications.

This module handles conversion of typespec AST to human-readable strings, supporting both simple types via Code.Typespec and complex types via manual formatting.

Summary

Functions

Formats a complete typespec declaration with function name, input types, and output type.

Formats a typespec AST into a human-readable string using Elixir's standard functions where possible.

Functions

format_full_typespec(function_name, input_types, output_type)

@spec format_full_typespec(atom(), [any()], any()) :: String.t()

Formats a complete typespec declaration with function name, input types, and output type.

format_type_for_display(type_ast)

@spec format_type_for_display(any()) :: String.t()

Formats a typespec AST into a human-readable string using Elixir's standard functions where possible.