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 in this release:
  - The list of types allowed in a sum type is now public
- Implicit qualifier conversions are now allowed in pattern matching
  - Better code examples in the documentation

This library is a work in progress. If you have a use case you'd like to see supported, or an API you'd like to see implemented, please get in touch!

Documentation: https://pbackus.github.io/sumtype/sumtype.html
DUB: https://code.dlang.org/packages/sumtype
Github: https://github.com/pbackus/sumtype

Reply via email to