Comment

Comment by andyferris

One thing I like is exploring the structural typing.

However I am confused if the enum's are structural or nominal. It seems necessary to state which enum a variant comes from, like `Direction of South` (for that matter it seems the same is true when constructing structs?). Can you cast enum values to a wider enum type? Or combine different enum values (e.g. through branching - the return of `match`) to construct a value of a wider enum?

parent andyferris 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton