Sum Types - first draft

Paul Backus snarwin at gmail.com
Wed Sep 11 00:09:51 UTC 2024


On Tuesday, 10 September 2024 at 22:57:05 UTC, Walter Bright 
wrote:
> On 9/10/2024 10:23 AM, Paul Backus wrote:
>>> I was approaching it from the other way around. Isn't a 
>>> non-nullable pointer a sumtype? Why have both non-nullable 
>>> types and sumtypes?
>> 
>> You have it exactly backwards. A _nullable_ pointer type is 
>> the sum of a non-nullable pointer type and typeof(null).
>
> "is the sum of..." makes it a sum type, doesn't it?

Let's compare and contrast your statement and my statement side 
by side:

     Yours: Isn't a non-nullable pointer    a sum type?
     Mine:        A     nullable pointer is a sum type.

Do you see the difference now?

I'm happy to explain anything that's unclear, but at this point, 
I'm beginning to suspect that you are only skimming my messages, 
not reading them all the way through.


More information about the dip.development mailing list