si14/z_validate — pull request #5 by shizzard (2012-11-14 08:35:07+00:00)
Title: z_apply custom errors

One-line patch.
Allows z_apply to handle custom errors from arg funs, e.g.

```
a(X) when is_integer(X) -> {ok, X*2};
a(X) when is_atom(X) -> {error, atom_not_allowed};
a(X) when is_list(X) -> {error, lists_not_allowed}.

z_apply(fun a/1, 123, {error, generic}), %% result is 246
z_apply(fun a/1, atom, {error, generic}), %% throws {error, atom_not_allowed}
z_apply(fun a/1, [a,b,c], {error, generic}), %% throws {error, lists_not_allowed}
z_apply(fun a/1, 123, {error, generic}). %% throws {error, generic} because of pattern mismatch
```