Need help figuring out how to fix dialyzer warning about using |

I’m not sure how to address the warning I’m getting from dialyzer about the typespec below:

defmodule Mastery.Core.Template do
  @moduledoc false

  @type t :: %__MODULE__{
          name: String.t(),
          category: String.t(),
          instructions: String.t(),
          raw: String.t(),
          compiled: Macro.t(),
          generators: %{subsitution: list | fun},
          checker: fun(list(String.t()), String.t()) :: boolean
        }
  defstruct ~w[name category instructions raw compiled generators checker]a
end

This is the warning:
warning: invalid type annotation. When using the | operator to represent the union of types, make sure to wrap type annotations in parentheses: fun(list(String.t()), String.t()) :: boolean
lib/mastery/core/template.ex:4

Any ideas?

fun() type does not accept arguments. You should better use -> arrow notation, like

checker: ([String.t()], String.t() -> boolean())