Skip to content

Instantly share code, notes, and snippets.

@renatorozas
Last active March 15, 2016 01:44
Show Gist options
  • Save renatorozas/1bf6324660d0b02a7c6c to your computer and use it in GitHub Desktop.
Save renatorozas/1bf6324660d0b02a7c6c to your computer and use it in GitHub Desktop.
Getting started with EUnit (Part 1)
-module(kv_db).
-type db() :: [].
-type results() :: nonempty_list({Key::atom(), Value::term()}).
-type err() :: {‘error’, string()}.
-export_type([db/0, results/0, err/0]).
% -spec new() -> db().
% -spec put(Key::atom(), Value::term(), Db::db()) -> results().
% -spec get(Key::atom(), Db::db()) -> term() | err().
% -spec delete(Key::atom(), Db::db()) -> (results() | nil()) | err().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment