   Constructs a map containing each item in `list`,
   and the number of times each one appears.
   """
+  @spec frequency_table(String.t) :: map
+  @spec frequency_table(list) :: map
+
   def frequency_table(string)
   when is_bitstring(string), do: string |> String.codepoints |> frequency_table
 

  @doc """
  Generates a list of letters based on the difficulty.
  """
  def generate_set(difficulty) do
    letters = generate_player_set(difficulty)

    words? =
      words
      |> using(letters)
      |> Enum.take(1)
  end

  def generate_player_set("easy") do
    frequencies(%{high: 5, med: 4, low: 2, pairs: 2}) # 20
  end

  Returns the most common item in `list`, or `nil` if
  there isn't one.
  """
  @spec most_common(list) :: any
  def most_common([n]), do: n
  def most_common(list) do
    list
