Skip to content

Version 0.8.0

Compare
Choose a tag to compare
@Qqwy Qqwy released this 04 Oct 08:40

Version 0.8.0 has been released! 馃殺

Additions & Improvements

  • Pretty-printing of types and TypeError output in multiple colors:

image

(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 calls require TypeCheck.Type so there no longer is a need to call this manually if you want to e.g. use TypeCheck.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 about Rating.t() and String.t() and only when looking at the problem in detail do we expand this to %Rating{} and binary().
  • [type] no longer creates a fixed_list(type) but instead a list(type) (just as Elixir's own typespecs.)
  • Support for [...] and [type, ...]as alias for nonempty_list() and nonempty_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 !