diff options
| -rw-r--r-- | .envrc | 1 | ||||
| -rw-r--r-- | src/main.app.src | 2 | ||||
| -rw-r--r-- | src/main.erl | 29 |
3 files changed, 26 insertions, 6 deletions
@@ -0,0 +1 @@ +use flake . diff --git a/src/main.app.src b/src/main.app.src index 0b7700a..34e2f46 100644 --- a/src/main.app.src +++ b/src/main.app.src @@ -2,7 +2,7 @@ {description, "A relational algebra engine"}, {vsn, "0.1.0"}, {registered, []}, - {mod, {main_app, []}}, + {mod, {main, []}}, {applications, [ kernel, stdlib, diff --git a/src/main.erl b/src/main.erl index 3c34a31..5b8d6e3 100644 --- a/src/main.erl +++ b/src/main.erl @@ -1,7 +1,26 @@ -module(main). --export([fibonacci/1]). +-behaviour(application). + +-export([start/2, stop/1]). + +start(_StartType, _StartArgs) -> + %% Start Mnesia (or other children) here + io:format("Starting app...~n"), + + %% Ensure Mnesia is started + mnesia:start(), + + {ok, self()}. + +stop(_State) -> + io:format("Stopping app...~n"), + ok. + +%% setup() -> +%% mnesia:create_table(attributes, [{type, set}, +%% {attributes, [name, value, type]}, +%% {ram_copies, [node()]}, +%% {index, [name]} +%% ]). + -fibonacci(0) -> 0; -fibonacci(1) -> 1; -fibonacci(N) -> - fibonacci(N-2) + fibonacci(N-1). |
