Interface Traversable<A,​T extends Traversable<?,​T>>

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default <B> Traversable<B,​T> fmap​(Fn1<? super A,​? extends B> fn)
      Covariantly transmute this functor's parameter using the given mapping function.
      <B,​App extends Applicative<?,​App>,​TravB extends Traversable<B,​T>,​AppTrav extends Applicative<TravB,​App>>
      AppTrav
      traverse​(Fn1<? super A,​? extends Applicative<B,​App>> fn, Fn1<? super TravB,​? extends AppTrav> pure)
      Apply fn to each element of this traversable from left to right, and collapse the results into a single resulting applicative, potentially with the assistance of the applicative's pure function.
      • Methods inherited from interface com.jnape.palatable.lambda.functor.Functor

        coerce
    • Method Detail

      • traverse

        <B,​App extends Applicative<?,​App>,​TravB extends Traversable<B,​T>,​AppTrav extends Applicative<TravB,​App>> AppTrav traverse​(Fn1<? super A,​? extends Applicative<B,​App>> fn,
                                                                                                                                                                      Fn1<? super TravB,​? extends AppTrav> pure)
        Apply fn to each element of this traversable from left to right, and collapse the results into a single resulting applicative, potentially with the assistance of the applicative's pure function.
        Type Parameters:
        B - the resulting element type
        App - the result applicative type
        TravB - this Traversable instance over B
        AppTrav - the full inferred resulting type from the traversal
        Parameters:
        fn - the function to apply
        pure - the applicative pure function
        Returns:
        the traversed Traversable, wrapped inside an applicative
      • fmap

        default <B> Traversable<B,​T> fmap​(Fn1<? super A,​? extends B> fn)
        Covariantly transmute this functor's parameter using the given mapping function. Generally this method is specialized to return an instance of the class implementing Functor.
        Specified by:
        fmap in interface Functor<A,​T extends Traversable<?,​T>>
        Type Parameters:
        B - the new parameter type
        Parameters:
        fn - the mapping function
        Returns:
        a functor over B (the new parameter type)