| unlock. -type lock_lock_resp () :: grant | wait. -type lock_resp () :: lock_lock_resp () | ok. -type lock_st () :: locked | unlocked. -spec handle_call(lock_req (), term(), lock_st ()) → {ok , lock_resp (), lock_st ()} | error (). handle_call(lock , _, locked) → {ok , wait , locked}; handle_call(lock , _, unlocked) → {ok , grant , locked}; handle_call(unlock , _, locked) → {ok , ok , unlocked}; handle_call(unlock , _, unlocked) → {ok , ok , unlocked}. Archibald Samuel Elliott, Edwin Brady Erlang/OTP Meets Dependent Types