1 2 3 4 5 6 7 8 9 10 11 12 13 14
use crate::prelude::Monad; impl<'a, A, E> Monad<'a, A> for Result<A, E> where A: 'a, { fn bind<F, B>(self, f: F) -> Self::Type<B> where F: Fn(A) -> Self::Type<B> + 'a, B: 'a, { self.and_then(f) } }