What are purposes of lib/sequence.ex and 'lib/sequence/application.ex

Following the book, I am confused how to implement mod: in mix.exs as entry point.
Elixir 1.5.0 version deploys lib/sequence/application.ex contained start().

  • lib/ - sequence.ex
    - sequence/ - application.ex
    So I set in mix.exs:
def application do
    [  mod: {Sequence.Application, []}   ]

This starts at the application.ex start().
Why do we have lib/sequence.ex like as main application and how to use this file?

Before elixir 1.4 or 1.5 the application start/2 callback was in lib/sequence.ex by default, not lib/sequence/application.ex. lib/sequence.ex is now usually used as a single public interface to other modules in lib/sequence/.

1 Like

Thank you for a reply.
I understood lib/sequence.ex is not used as the entry point and it seems to use common interface as Ruby structure.
However, it is a little bit difficult for me to read code from the start point step by step.
I think Ruby is OK as OOP, although it is why I can’t be familiar with it.
lib/sequence.ex is meaningless as it works without this. Maybe I am not at enough level to see the useful point on this.