sumtype 1.0.0
Paul Backus
snarwin at gmail.com
Sun Nov 15 20:05:16 UTC 2020
SumType is a generic discriminated union type for modern D. It is
designed to
be an improved alternative to `std.variant.Algebraic`.
Features:
- Pattern matching, including:
- Match-by-introspection ("if it compiles, it matches") (★)
- Multiple dispatch (★)
- Support for self-referential types (`This`).
- Works with `pure`, `@safe`, `@nogc`, `nothrow`, and
`immutable` (★)
- Compatible with `-betterC` and `-dip1000` (★)
- 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`.
With this release, SumType's public API is officially considered
stable. No
breaking API changes will be made from this release forward
without a major
version bump.
Improvements since 0.10.0, the last announced version:
- Copy constructors of SumType members are now called correctly.
- Self-referential SumTypes can now contain self-referential
Algebraics, and
vice versa.
- SumType is now tested on Windows in addition to Linux and Mac
OS X.
Links:
- Documentation: https://pbackus.github.io/sumtype/sumtype.html
- DUB: https://code.dlang.org/packages/sumtype
- Github: https://github.com/pbackus/sumtype
More information about the Digitalmars-d-announce
mailing list