fn foldr<'a, A, B, F: Fn(A::Item, B) -> B + 'a>(self, f: F) -> Foldr<Self, F, A, B>
    where
        Self: Parser<I, (A, B)> + Sized,
        A: IntoIterator,
        A::IntoIter: DoubleEndedIterator,
    { Foldr(self, f, PhantomData) }
/// Right-fold the output of the parser into a single value.
///
/// The output of the original parser must be of type `(impl IntoIterator<Item = A>, B)`. Because right-folds work
/// backwards, the iterator must implement [`DoubleEndedIterator`] so that it can be reversed.
///
/// # Examples
///
/// ```
/// # use chumsky::{prelude::*, error::Cheap};
/// let int = text::int::<char, Cheap<char>>(10)
///     .map(|s| s.parse().unwrap());
///
/// let signed = just('+').to(1)
///     .or(just('-').to(-1))
///     .repeated()
///     .then(int)
///     .foldr(|a, b| a * b);
///
/// assert_eq!(signed.parse("3"), Ok(3));
/// assert_eq!(signed.parse("-17"), Ok(-17));
/// assert_eq!(signed.parse("--+-+-5"), Ok(5));
/// ```
Right-fold the output of the parser into a single value.
The output of the original parser must be of type `(impl IntoIterator, B)`. Because right-folds work
backwards, the iterator must implement [`DoubleEndedIterator`] so that it can be reversed.
Right - fold the output of the parser into a single value . The output of the original parser must be of type ` ( impl IntoIterator B ) ` . Because right - folds work backwards the iterator must implement [ ` DoubleEndedIterator ` ] so that it can be reversed .
fn foldr<'a, A, B, F: Fn(A::Item, B) -> B + 'a>(self, f: F) -> Foldr<Self, F, A, B>
    where
        Self: Parser<I, (A, B)> + Sized,
        A: IntoIterator,
        A::IntoIter: DoubleEndedIterator,
    { Foldr(self, f, PhantomData) }
fn foldr < ' a , A , B , F : Fn ( A :: Item , B ) -> B + ' a > ( self , f : F ) -> Foldr < Self , F , A , B > where Self : Parser < I , ( A , B ) > + Sized , A : IntoIterator , A :: IntoIter : DoubleEndedIterator , { Foldr ( self , f , PhantomData ) }
Right-fold the output of the parser into a single value.
Right - fold the output of the parser into a single value .
self
f
F
examples
None
use chumsky::{prelude::*, error::cheap};
None