I have recently started with Elixir. I am trying to implement a module to read data from stdio using Flow and I get the error below. I assume I need a require or some kind of dependency, but I cannot find anything to require. Has anyone an insight into this?
I have ubuntu 16.04 and whereis is as follows -
trevor@trevor-Lenovo-YOGA-510-14AST:~/elixir$ whereis elixir
elixir: /usr/bin/elixir /usr/lib/elixir /usr/share/man/man1/elixir.1.gz
Error -
** (UndefinedFunctionError) function Flow.from_enumerable/1 is undefined (module Flow is not available)
Flow.from_enumerable(%IO.Stream{device: :standard_io, line_or_bytes: :line, raw: true})
mmaze.ex:31: Solution.read_bin/0
(elixir 1.10.3) lib/code.ex:926: Code.require_file/2
Module -
defmodule Solution do
def read_bin() do
IO.binstream(:stdio, :line)
|> Flow.from_enumerable()
|> IO.puts
end
end
Solution.read_bin()