sumtype 0.7.0

Paul Backus snarwin at gmail.com
Wed Nov 21 00:38:25 UTC 2018


SumType is a generic sum type for modern D. It is meant as an 
alternative to `std.variant.Algebraic`.

Features:
   - Pattern matching, including support for structural matching 
(★)
   - Self-referential types, using `This`
   - Works with pure, @safe, @nogc, and immutable (★)
   - Zero runtime overhead compared to hand-written C
     - No heap allocation
     - Does not rely on runtime type information (`TypeInfo`) (★)

Starred features (★) are those that are missing from `Algebraic`.

Code examples are available in the documentation (linked below).

New since the last announced version, 0.5.3:
   - SumType is now 100% @safe!
   - `match` now considers all overloads of functions passed as 
handlers.
   - Several bugs affecting const and immutable SumTypes have been 
fixed.
   - Comparison of SumTypes with the `==` operator now correctly 
forwards
     to the contained type's `==` operator.
   - A couple of confusing error messages have been improved.
   - Test builds on Travis CI now use both LDC and DMD.

Many thanks to Atila Neves for his contributions to this release. 
In particular, the changes to `match` and the `==` operator are 
the result of his efforts. It's been a pleasure working with him, 
and I hope to have more opportunities to do so.

Links:
   - Documentation: https://pbackus.github.io/sumtype/sumtype.html
   - DUB: https://sumtype.dub.pm
   - Github: https://github.com/pbackus/sumtype



More information about the Digitalmars-d-announce mailing list