Permalink
Browse files

FUNCT better types for the history log

This is backwards incompatible, but makes it possible to tell normal returns
from exceptions safely
  • Loading branch information...
samuelrivas committed Jul 3, 2013
1 parent 999e8f4 commit d12d119a96e137786e785b6b3fbfd4b242ea874d
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/moka.erl
View
@@ -50,14 +50,17 @@
-opaque moka() :: atom().
-type history_entry() :: {funct_spec(), Args::[any()], Result::result()}.
--type result() :: Return::any() | {exception, class(), Reason::any()}.
-type funct_spec() :: {Module::module(), FunctionName::atom()}.
+-type result() :: return() | exception().
+-type return() :: {return, Value::any()}.
+-type exception() :: {exception, class(), Reason::any()}.
-type class() :: throw | exit | error.
-type history() :: [history_entry()].
%% History entries are sorted chronologically, oldest first
--export_type([moka/0, history/0, history_entry/0]).
+-export_type([moka/0, history/0, history_entry/0, result/0, return/0,
+ exception/0, class/0]).
%%%===================================================================
%%% API

0 comments on commit d12d119

Please sign in to comment.