sumtype 0.8.3

Paul Backus snarwin at gmail.com
Mon Feb 25 20:31:43 UTC 2019


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.7.0:
   - SumType now accepts non-copyable types as members.
   - A new template, `canMatch`, allows querying the matching 
logic directly.
   - A bug in the `==` operator of self-referential SumTypes has 
been fixed.
   - An exception-safety bug in SumType's assignment operator has 
been fixed.
   - The documentation and examples have been given some 
additional polish.

Special thanks to Atila Neves and John Colvin for their 
contributions to this
release.

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