erlang
Installation
SKILL.md
Critical Patterns
OTP GenServer (REQUIRED)
-module(counter).
-behaviour(gen_server).
-export([start_link/0, increment/0, get/0]).
-export([init/1, handle_call/3, handle_cast/2]).
start_link() ->
gen_server:start_link({local, ?MODULE}, ?MODULE, [], []).
init([]) -> {ok, 0}.
handle_call(get, _From, State) ->
{reply, State, State}.