Skip to content

Instantly share code, notes, and snippets.

View Aras14HD's full-sized avatar
💭
currently focusing on School

Aras Aras14HD

💭
currently focusing on School
View GitHub Profile
@Aras14HD
Aras14HD / README.md
Last active August 25, 2024 19:57
A Unified Typesystem: Partial, Variant, Borrowed Types and more

A Unified Typesystem: Partial, Variant, Borrowed Types and more

Recently I stumbled over the blog post The Inconceivable Types of Rust.

It stuck with me, the ideas were great, but felt unpolished, so I thought about it and I want to share those thoughts with you. In this post I aim to outline what these concepts are and their applications, what syntax I feel fits well, and broadly how one might design a type checker for this.

Partials

Let's start with partial types, these already kind of exist in Rust in, what Considerations on Codecrafting called it, a shadow type system. A partial types is the type of variable, that has been partially moved or initialized (or borrowed or variant). These are currently undescribable and only exist within functions, a way to write them could be:

@Aras14HD
Aras14HD / music.txt
Last active February 1, 2025 17:48
My Music List (Mostly (Electro) Swing and texture electronic)
Animal Soul Brighton - The Swing Ninjas
"Fall Again", "In The Hall Of The Mountain King" and "Di Grine Kuzine" - Dabchick - Citri FF
(Hey, Brother) What Have You Done? - Odd Chap & Lyre Le Temps
- - Patricia Taxxon
- - Patricia Taxxon
100 - Elle & The Pocket Belles
100% - Atom Smith
12 juin 3049 - Caravan Palace
2000 Volts - Big Bad Voodoo Daddy
20S Are Here (Club Mix) - Riff Kitten & Alanna Lyes