Hacker News new | ask | show | jobs
by u320 3800 days ago
Yes but the Rust type system cannot express monads, so they aren't monads in the type sense (they don't implement a specific Monad trait).
2 comments

Fun Trivia Fact: Rust's type system was[1] Turing complete. So you could actually have monads. You just wouldn't want to.

1: The program that proved this no longer compiles, so we're not sure if the type system is or is not at the moment.

I would love to see this program. Maybe even spend some time trying to get it to compile.
I think this is still possible with associated types. You can imitate higher kinded types with associated types, just that you wouldn't want to.

I recall someone posting a Monad or Collection HKT example when associated types were proposed.