YatoRust
u/YatoRust
Generalizing over Generics in Rust (Part 1) - AKA Higher Kinded Types in Rust
rustyyato.github.io/type/system,type/families...This library is very similar to aljabar (in fact it was inspired by it). It improves upon it by giving panic safety and elementwise access (edit: latest update of aljabar does have these properties, but it still leaks on panics, whereas const-alg does not leak on panics). Also it gives iterators over rows and columns!
This is backed by my second crate, array-vec, which is a minimal fixed capacity vector backed by an array.
https://crates.io/crates/const-alg
https://crates.io/crates/array-vec
You can create a matrix very simply, just do
use const_alg::Matrix;
Matrix(
[[0, 1, 2],
[3, 4, 5]]
)
and that will cr
Relative Pointer: an abstraction to build movable self-referential types
https://crates.io/crates/rel-ptr
Use relative pointers to build safe movable self-referential types or minimize the size of your pointers!
Example of self referential struct
use rel_ptr::RelPtr;
struct SelfRef {
value: (String, u32),
ptr: RelPtr<String>
}
impl SelfRef {
pub fn new(s: String, i: u32) -> Self {
let mut this = Self {
value: (s, i),
ptr: RelPtr::null()
};
this.ptr.set(&this.value.0).unwrap();
this
}
pub fn fst(&self) -> &
I made a blog post explaining how closures are desugared and how they operate because I found quite a few questions here on users related to closures.
https://krishnasannasi.github.io/rust/syntactic/sugar/2019/01/17/Closures-Magic-Functions.html
You've reached the end of this feed.

