You need to use the module Streamto create an infinity sequence. One way to do this is to:
Stream.repeatedly(fn -> Enum.random(["hello", "world", "foo bar", "baz"]) end)
|> Enum.take(25)
This is an elixir 1.1 due Enum.random/1. Take a look at the module documentation Stream.
UPDATE 1:
take characters with the same approach:
defmodule CustomEnum do
def take_chars_from_list(list, chars) do
Stream.repeatedly(fn -> Enum.random(list) end)
|> Enum.reduce_while([], fn(next, acc) ->
if String.length(Enum.join(acc, " ")) < chars do
{:cont, [next | acc]}
else
{:halt, Enum.join(acc, " ")}
end
end)
|> String.split_at(chars)
|> elem(0)
end
end
This one character stripe after n.