Comment

Comment by 9rx

Using interface as it was designed to be used offers first-class sum types. Although not all interface use equates to sum types.

But they're not tagged unions. I expect that is still where your confusion lies. Tagged unions and sum types are not equivalent. Tagged unions are a subset of sum types.

parent 9rx 8 months ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton