Version 0.8.0
Version 0.8.0 has been released! 馃殺
Additions & Improvements
- Pretty-printing of types and TypeError output in multiple colors:
(This is the 'Rating' example from the Type-checking and spec-testing with TypeCheck article).
Types and values are pretty-printed in colour, similarly to how this is normally done in IEx.
- Nicer indentation of errors. Amongst other things, this means that error-highlighting in the documentation now works correctly (although in 100% 'red').
use TypeCheck
now also callsrequire TypeCheck.Type
so there no longer is a need to call this manually if you want to e.g. useTypeCheck.Type.build/1
(which is rather common if you want to test out particular types quickly in IEx).- named types are now printed in abbreviated fashion if they are repeated multiple times in an error message. This makes a nested error message much easier to read, especially for larger specs.
- Remote/user-defined types are now also 'named types' which profit from this change.
For instance in above example picture, we first talk aboutRating.t()
andString.t()
and only when looking at the problem in detail do we expand this to%Rating{}
andbinary()
. [type]
no longer creates afixed_list(type)
but instead alist(type)
(just as Elixir's own typespecs.)- Support for
[...]
and[type, ...]
as alias fornonempty_list()
andnonempty_list(type)
respectively.
Fixes
- Fixes prettyprinting of
TypeCheck.Builtin.Range
. - Remove support for list literals with multiple elements.
- Improved documentation. c.f. #56
Thank you very much, @baldwindavid and @0urobor0s !