Comment

Comment by revskill

One of most frequent usage of a type system is literal types.

Haskell, Rust,... and modern programming languages fail to do it. The only exception is Typescript.

For example, simple way to adding a extended boolean type:

type MyBoolean = null | true | false.

Or

type MyRange = 3 | 4 | 5

Curious.

parent revskill 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton