Enum.chunk_by/2

defmodule Enum do
  def chunk_by(enumerable, fun)
end

Splits enumerable on every element for which fun returns a new value.