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.
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: