3 ms·
If taking monads to Rust takes such convoluted code, my conclusion would be that it probably isn't a good fit. Compared to this, Haskell is a breeze.
by tempodox 8y ago
If taking monads to Rust takes such convoluted code, my conclusion would be that it probably isn't a good fit. Compared to this, Haskell is a breeze.
- nine_k 8y agoOne of the purposes of publishing such papers, as see it, is triggering responses with simpler, easier proposals. They may cover the important 90% of the original, doing away with the most complexity-inducing 10%.
- empath75 8y agoImplementing monads will be convoluted, using them is relatively easy. It wouldn’t change any of the existing code, but it would allow you to write a function like this: fn double_inner<M: Monad<u64>>(m: M) -> M { m.bind(|x| M::unit(x * 2)) } Which takes anything wrapping an integer and doubles it, whether it’s an option or result or iterator.