   defp in_range(left, first, last) do
     case is_integer(first) and is_integer(last) do
       true  ->
-        case first < last do
-          true ->
-            quote do
-              :erlang.is_integer(unquote(left)) and
-                unquote(increasing_compare(left, first, last))
-            end
-          false ->
-            case first > last do
-              true ->
-                quote do
-                  :erlang.is_integer(unquote(left)) and
-                    unquote(decreasing_compare(left, first, last))
-                end
-              false ->
-                quote do
-                  unquote(left) === unquote(first)
-                end
-            end
-        end
+        in_range_literal(left, first, last)
       false ->
         quote do
           (:erlang.is_integer(unquote(left)) and

    end
  end

  defp in_list(left, h, t) do
    :lists.foldr(fn x, acc ->
      quote do: :erlang.or(unquote(comp(left, x)), unquote(acc))

  defp increasing_compare(var, first, last) do
    quote do
      :erlang.">="(unquote(var), unquote(first)) and
        :erlang."=<"(unquote(var), unquote(last))
    end
  end

  defp decreasing_compare(var, first, last) do
    quote do
      :erlang."=<"(unquote(var), unquote(first)) and
        :erlang.">="(unquote(var), unquote(last))
    end
  end

