defmodule Queens do
  @type t :: %Queens{black: {integer, integer}, white: {integer, integer}}
  defstruct black: nil, white: nil

  @doc """
  Creates a new set of Queens
  """
  @spec new({integer, integer}, {integer, integer}) :: Queens.t()
  def new(white, black) do
  end

  @doc """
  Gives a string representation of the board with
  white and black queen locations shown
  """
  @spec to_string(Queens.t()) :: String.t()
  def to_string(queens) do
  end

  @doc """
  Checks if the queens can attack each other
  """
  @spec can_attack?(Queens.t()) :: boolean
  def can_attack?(queens) do
  end
end

defmodule Queens do
  @type t :: %Queens{black: {integer, integer}, white: {integer, integer}}
  defstruct black: nil, white: nil

  @doc """
  Creates a new set of Queens
  """
  @spec new() :: Queens.t()
  @spec new({integer, integer}, {integer, integer}) :: Queens.t()
  def new(white \\ nil, black \\ nil) do
  end

  @doc """
  Gives a string representation of the board with
  white and black queen locations shown
  """
  @spec to_string(Queens.t()) :: String.t()
  def to_string(queens) do
  end

  @doc """
  Checks if the queens can attack each other
  """
  @spec can_attack?(Queens.t()) :: boolean
  def can_attack?(queens) do
  end
end

Add default values to queen-attack `Queens.new/2`
Add default values to queen-attack `Queens.new/2`

They are however, invalid in the context of this exercise. We are adding
them so that we can bring back the spec for `Queens.new/0` which was
removed wrongly, the spec is supposed to be there to show students this
style of writing specs. However, for the code to compile, the function
`Queens.new/0` needs to exist so we are "creating" it by adding defaults
to `Queens.new/2`.

exercism/xelixir