Truly algebraic Variant and Nullable

Oleg B code.viator at gmail.com
Mon Dec 21 13:00:14 UTC 2020


On Sunday, 20 December 2020 at 11:00:05 UTC, Tobias Pankrath 
wrote:
> On Sunday, 15 November 2020 at 04:54:19 UTC, 9il wrote:
>> Truly algebraic Variant and Nullable with an order-independent 
>> list of types.
>
> Thanks for sharing it!
>
> Could you give a (very short) explanation on why sumtype could 
> not meet your requirements? I am just starting a new D project 
> and have to choose between sumtype and your solution.
>
>>
>> The work has been sponsored by Kaleidic Associates and 
>> Symmetry Investments.
>
> Much appreciated!

For me choose between sumtype and mir.algebraic ends when I not 
found
any solution for working with type kind [1] in sumtype. Kind 
represents in
taggedalgebraic [2] too, but it can't work in compile time 
(important for
me in current project). Also I find tagged_union [3] library, but 
it haven't
any visit [4] or match functions.

[1] http://mir-core.libmir.org/mir_algebraic.html#.TaggedVariant
[2] https://code.dlang.org/packages/taggedalgebraic
[3] https://code.dlang.org/packages/tagged_union
[4] http://mir-core.libmir.org/mir_algebraic.html#visit


More information about the Digitalmars-d-announce mailing list