4 ms·
You can do something similar in Rust to ML modules using traits and generic impls as module functors! https://play.rust-lang.org/?version=stable&mode=debug&edi
by jlrubin 6y ago
You can do something similar in Rust to ML modules using traits and generic impls as module functors!
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=8bebb69fa7898b13c731ccef158c0e4b https://play.rust-lang.org/?version=stable&mode=debug&editio...
This can be really useful especially as traits with differing concrete types diverge, you can create a unified interface trait object to allow trait objects for things like container classes.