fn foldl<A, B, F: Fn(A, B::Item) -> A>(self, f: F) -> Foldl<Self, F, A, B>
    where
        Self: Parser<I, (A, B)> + Sized,
        B: IntoIterator,
    { Foldl(self, f, PhantomData) }
/// Left-fold the output of the parser into a single value.
///
/// The output of the original parser must be of type `(A, impl IntoIterator<Item = B>)`.
///
/// # Examples
///
/// ```
/// # use chumsky::{prelude::*, error::Cheap};
/// let int = text::int::<char, Cheap<char>>(10)
///     .map(|s| s.parse().unwrap());
///
/// let sum = int
///     .then(just('+').ignore_then(int).repeated())
///     .foldl(|a, b| a + b);
///
/// assert_eq!(sum.parse("1+12+3+9"), Ok(25));
/// assert_eq!(sum.parse("6"), Ok(6));
/// ```
Left-fold the output of the parser into a single value.
The output of the original parser must be of type `(A, impl IntoIterator)`.
Left - fold the output of the parser into a single value . The output of the original parser must be of type ` ( A impl IntoIterator ) ` .
fn foldl<A, B, F: Fn(A, B::Item) -> A>(self, f: F) -> Foldl<Self, F, A, B>
    where
        Self: Parser<I, (A, B)> + Sized,
        B: IntoIterator,
    { Foldl(self, f, PhantomData) }
fn foldl < A , B , F : Fn ( A , B :: Item ) -> A > ( self , f : F ) -> Foldl < Self , F , A , B > where Self : Parser < I , ( A , B ) > + Sized , B : IntoIterator , { Foldl ( self , f , PhantomData ) }
Left-fold the output of the parser into a single value.
Left - fold the output of the parser into a single value .
self
f
F
examples
None
use chumsky::{prelude::*, error::cheap};


let sum = int
.then(just('+').ignore_then(int).repeated())
.foldl(|a, b| a + b).


let sum = int . then ( just ( ' + ' ) . ignore_then ( int ) . repeated () ) . foldl ( |a b| a + b ) .