Enum.take_while/2

defmodule Enum do
  def take_while(enumerable, fun)
end

Takes the elements from the beginning of the enumerable while fun returns a truthy value.