Interesting paper on composing type definitions

bpr via Digitalmars-d digitalmars-d at
Mon Mar 6 14:02:54 PST 2017

On Monday, 6 March 2017 at 21:22:46 UTC, Timon Gehr wrote:
> On 06.03.2017 21:49, Enamex wrote:
>> On Monday, 6 March 2017 at 01:37:18 UTC, Andrei Alexandrescu 
>> wrote:
>>> On 3/4/17 10:36 PM, Andrei Alexandrescu wrote:
>> I haven't read the paper yet but doesn't that sound exactly 
>> opposite to
>> what 'sum types' is usually used to mean?
>> The value of the variable has to be either A or B. If it 
>> stores the
>> status of both then it's basically a struct, right?
>> Probably I'm misunderstanding your point on composition and 
>> 'joint API'.
> I don't think you are. The paper is using non-standard 
> terminology.

You're right. 'Sum' in that paper joins the interfaces, so it's 
really 'product' in the fairly standard type theory terminology. 
I wish they hadn't done that, it makes communication harder than 
it has to be.

Here's a recent post from our cousins in the Rust belt

which may make things clearer to people unfamiliar with that 

More information about the Digitalmars-d mailing list