Enable -Wunderspecs in Makefile.

Underspecs ensure that dialyzer will warn about types that are underspecified:
the specification allows a wider set of types than dialyzer can infer. Enabling
this _also_ seems to catch errors that are not set width so much as just not
applicable, [[spec_fun()]] for the desired [spec_fun()] in the last commit.

Had -Wunderspecs been enabled the last bug would not have gone through.

Signed-off-by: Brian L. Troutwine <brian@troutwine.us>
Create an example and update the README.

The README bothered me for being damn near unreadable. The REPL bit is still
hard, but now there's some example code and _that_ at least is more simple to
read.

Signed-off-by: Brian L. Troutwine <brian@troutwine.us>
Merge pull request #4 from blt/enable_underspecs

Enable -Wunderspecs in Makefile.
Merge pull request #5 from blt/better_examples

Create an example and update the README.
Override default spec name pattern
Update README.md
Update specs to reflect non-empty list intentions.

In the commit for #7 Mike disabled -Wunderspecs because of

    lye.erl:26: Type specification lye:check(structure(),Specs::[spec()]) -> 'ok' | [error()] is a supertype of the success typing: lye:check(_,[atom() | fun((_) -> 'ok' | {'error',binary()}) | tuple()]) -> 'ok' | [{'error',binary()},...]

That's sort of hard to read. Dialzyer is saying that the spec we gave check/2
was too permisive: the domain is expressible as a smaller set; that's the
'supertype of the success typing'. While it was our intention never to return an
empty list from check/2 our types asserted that we _might_.

A liberal sprinkling of nonempty_list() solves the issue and more correctly
expresses our intention.

Signed-off-by: Brian L. Troutwine <brian@troutwine.us>
Demonstrate that we raise an error for spec funs of wrong arity.

If a spec function doesn't have arity 1 this is a problem, as mentioned by Mike
in #8. `normalize_spec/2` was written to exclude such bad arity functions but
this was never explicitly asserted.

Signed-off-by: Brian L. Troutwine <brian@troutwine.us>
Merge pull request #1 from blt/msassak_enable_defaults

Update specs to reflect non-empty list intentions.
Merge pull request #7 from msassak/enable-defaults

Override default spec name pattern
Merge pull request #10 from blt/fail_on_bad_arity

Demonstrate that we raise an error for spec funs of wrong arity.
Collapse errors into a single list; partially solves issue #6.

Rather than issue a list of {error, Reason} we now issue {error, [Reason]}. The
change is relatively minor but makes matching somewhat simpler.

Signed-off-by: Brian L. Troutwine <brian@troutwine.us>
Merge pull request #11 from blt/collapse_errors

Collapse errors into a single list; partially solves issue #6.