I have the following module in my priv/ directory:
defmodule MyModule do
def hello(s) do
when I mix run priv/funwithfuncs.exs:
** (CompileError) priv/funwithfuncs.exs:5: undefined function hello/1
How do I define a function in a seed/exs file??
When you try to call
hello/1 it does not exist.
If you though call that function after that module has been fully created (thats with the
end that belongs to
defmodule M do) then it works:
$ cat foo.exs
defmodule M do
def hello(s), do: IO.puts(s)
$ elixir foo.exs