       fn
         entry, acc(head, curr, tail) when curr in [unquote(nth), :first] ->
           next_with_acc(unquote(fun), entry, head, 1, tail)
+
         entry, acc(head, curr, tail) ->
           skip(acc(head, curr + 1, tail))
       end

    quote do
      fn entry, acc(head, prev, tail) = acc ->
        value = unquote(callback).(entry)
        case prev do
          {:value, ^value} -> skip(acc)
          _ -> next_with_acc(unquote(fun), entry, head, {:value, value}, tail)

        case curr do
          0 ->
            {:halt, original}

          1 ->
            {_, acc} = next_with_acc(unquote(fun), entry, head, 0, tail)
            {:halt, acc}

          _ ->
            next_with_acc(unquote(fun), entry, head, curr - 1, tail)
        end
