   alias Code.Identifier
 
   @typedoc "Abstract Syntax Tree (AST)"
-  @type t :: expr | literal
-
-  @typedoc "Represents expressions in the AST"
-  @type expr :: {expr | atom, keyword, atom | [t]}
-
-  @typedoc "Represents literals in the AST"
-  @type literal :: atom | number | binary | fun | {t, t} | [t]
+  @type t :: input
+
+  @typedoc "The inputs of a macro"
+  @type input ::
+          input_expr
+          | {input, input}
+          | [input]
+          | atom
+          | number
+          | binary
+
+  @typep input_expr :: {input_expr | atom, keyword, atom | [input]}
+
+  @typedoc "The output of a macro"
+  @type output ::
+          output_expr
+          | {output, output}
+          | [output]
+          | atom
+          | number
+          | binary
+          | captured_remote_function
+          | pid
+
+  @typep output_expr :: {output_expr | atom, keyword, atom | [output]}
+
+  @typedoc "A captured remote function in the format of &Mod.fun/arity"
+  @type captured_remote_function :: fun
 
   @doc """
   Breaks a pipeline expression into a list.


defmodule Macro do
  @moduledoc ~S"""
  Conveniences for working with macros.

  ## Custom Sigils

  To create a custom sigil, define a function with the name
  `sigil_{identifier}` that takes two arguments. The first argument will be
  the string, the second will be a charlist containing any modifiers. If the
  sigil is lower case (such as `sigil_x`) then the string argument will allow
  interpolation. If the sigil is upper case (such as `sigil_X`) then the string
  will not be interpolated.

  Valid modifiers include only lower and upper case letters. Other characters
  will cause a syntax error.

  Returns `true` if the given quoted expression is an AST literal.
  """
  @doc since: "1.7.0"
  @spec quoted_literal?(t) :: boolean
  def quoted_literal?(term)

  def quoted_literal?({left, right}), do: quoted_literal?(left) and quoted_literal?(right)
