IO.stream(:stdio, :line)|> Enum.take_while(&(&1 != "42\n"))|> Enum.map(&String.trim(&1))|> Enum.each(&IO.puts(&1))
It gives a NZEC runtime error