Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Typedefs. Parent comment
I always thought these examples were real ADT's:
``` type Bool = true | false;
type Maybe<T> = T | null;
type SumTypeExample = Bool | Maybe<Bool>
interface ProductType1 { b: Bool c: Maybe<Bool> }
interface ProductType2 { s: "a" | "b" | "c" }
interface ProductTypeComposite extends ProductType1, ProductType2 {} ```
Can you explain what's the difference?
There are no comments on this comment yet.
I always thought these examples were real ADT's:
``` type Bool = true | false;
type Maybe<T> = T | null;
type SumTypeExample = Bool | Maybe<Bool>
interface ProductType1 { b: Bool c: Maybe<Bool> }
interface ProductType2 { s: "a" | "b" | "c" }
interface ProductTypeComposite extends ProductType1, ProductType2 {} ```
Can you explain what's the difference?