Hacker News new | ask | show | jobs
by jlrubin 2050 days 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&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.