Worst ideas/features in programming languages?

James Blachly james.blachly at gmail.com
Mon Oct 11 20:41:33 UTC 2021


On 10/11/21 1:35 PM, russhy wrote:
> On Monday, 11 October 2021 at 16:12:59 UTC, FeepingCreature wrote:
>> On Monday, 11 October 2021 at 15:59:10 UTC, Atila Neves wrote:
>> Sumtypes should be built-in, and they should implicitly construct from 
>> its member types.
> 
> I 100% agree with you

100%. I am really loving Ilya's `mir.algebraic` for my sumtype needs:

http://mir-core.libmir.org/mir_algebraic.html

> Same for Nullable/Optional in my opinion

Likewise mir algebraic has Nullable. But what it (and D overall as a 
builtin) is really missing is Result type (with Ok and Err tags) -- will 
be eagerly checking out Chaloupka's `expected` package soon.

PS:

>> But I'm actually convinced that the worst thing is the lack of
>> implicit construction for sumtypes. Because when you try to actually
>> use sumtypes, you end up with stuff like
>> `Nullable!MySumType(MySumType(MemberType("Hello World")))`.

https://run.dlang.io/is/XUtxwm  :)


More information about the Digitalmars-d mailing list