5 ms·
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).
by u320 11y 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).
- steveklabnik 11y agoFun 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.
- eximius 11y agoI would love to see this program. Maybe even spend some time trying to get it to compile.
- steveklabnik 11y agohttps://www.reddit.com/r/rust/comments/2o6yp8/brainfck_in_rusts_type_system_aka_type_system_is/cmkrjz2 https://www.reddit.com/r/rust/comments/2o6yp8/brainfck_in_ru... was one of them
- Manishearth 11y agoI 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.