How to run a single function in an Elixir application?
<p>I need create the equivalent of a <code>main</code> function for my project. I need add some dependencias to the project and use them to run a single function. I really don't need an OTP app so I think do define it like that (with supervisor and everything) would be an overkill.</p>

<p>I did a test and put it in the <code>mix.ex</code> like this and it works</p>

<pre><code>def application do
  MyModule.main

  [applications: [:logger]]
end
</code></pre>

<p>but feels unnatural. Is there a more standard way of doing this?</p>

<p><strong>EDIT:</strong></p>

<p>Putting it inside <code>application</code> only works the first time it compiles for some reason.</p>