8 fn bind(self, f: F) -> Self::Output;
11 fn bind<T, U, A, B, F>(mut a: A, mut f: F)
12 -> impl FnMut(&mut State) -> Result<U, Error>
13 where F: FnMut(T) -> B,
14 A: FnMut(&mut State) -> Result<T, Error>,
15 B: FnMut(&mut State) -> Result<U, Error>
23 fn atom<T>(x: T) -> impl FnMut(&mut State) -> Result<T, Error> {
25 move |_| x.take().map_or(Err(()), Ok)
29 assert_eq!(bind(atom(5), |x| atom(x > 4))(&mut State), Ok(true));