Follow

@ekaitz_zarraga

Another thing I'd like to experiment in language design is a typesystem based on Cantor's set theory.

Basically, a type is a logic predicate that is granted to always stay true during the data lifetime.

Such approach meld the difference between structural type system, nominative type system and (value-)dependent type system.

If you have two types, Integer and Even, you can pass an Integer to a function than takes an Even only if you have checked if such integer is even.

And, obviously, you can always use an Even value when you need an Integer.

Imagine a `head` function that only apply to NonEmptyList, that is a List whose length is greater than 0, and so on.

Why Cantor set theory?

Because people learn it at primary school and well... I'm naive... just like . ๐Ÿ˜‰

ยท ยท 0 ยท 0 ยท 1
Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.