Modern C++ Lamentations

Timon Gehr timon.gehr at gmx.ch
Mon Dec 31 22:28:42 UTC 2018


On 30.12.18 22:12, sarn wrote:
> On Sunday, 30 December 2018 at 16:51:07 UTC, Jacob Carlborg wrote:
>> On 2018-12-30 15:46, Andrei Alexandrescu wrote:
>>> On 12/29/18 9:03 PM, Timon Gehr wrote:
>>>> alias then(alias a)=(r)=>map!a(r).joiner;
>>> The "then" abstraction is pretty awesome. Thanks!
>>
>> Isn't that usually called "flatMap"?
> 
> Yeah, in Haskell monad terminology, "then" means >>, but flatMap is >>= 
> ("bind").  So flatMap is a less confusing name for some people.

Pun intended. Welcome to D, where 'enum' means 'const', 'const' means 
'readonly', 'lazy' means 'by name', 'assert' means 'assume' and 'real' 
does not mean 'real' (in fact, I really like the 'ireal' and 'creal' 
keywords, pity they are being phased out). :)

The wider context is that I have argued many times that it makes sense 
to put 'trivial' one-liners like this one into Phobos even if for no 
other reason than to standardize their names.


More information about the Digitalmars-d mailing list