RFC: std.sumtype (adding sumtype to Phobos)

Petar Petar
Wed Nov 25 16:11:32 UTC 2020


On Wednesday, 25 November 2020 at 15:50:47 UTC, bachmeier wrote:
>
> The "Basic Usage" examples show functions preceded by "pure 
> @safe @nogc nothrow". Is that required? If so, do we want to go 
> down the path of adding that kind of verbosity/complexity to 
> Phobos libraries? That would be a substantial change from what 
> we have now. It would definitely make the language less 
> appealing (particularly with two starting with @ and two not).

IMO, attributes like that should remain in the source code (e.g. 
the `unittest` blocks from which the docs are built), but not 
shown in the web page, unless the user hovers over the functions. 
IIRC, we already do that for template contraints.

Additionally, template functions which don't have any attributes, 
but have corresponding `unittest`s with attributes, should be 
displayed in the docs as `pure`-enabled `@safe`-enabled or 
something along those lines. That's somewhat related to the ADA 
(Argument Dependent Attribute set) proposal that Mathias 
presented at this DConf [1].

[1]: https://youtu.be/9lOtOtiwXY4?t=946


More information about the Digitalmars-d mailing list