Interface Applicative<A,​App extends Applicative<?,​App>>

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default <B> Applicative<B,​App> discardL​(Applicative<B,​App> appB)
      Sequence both this Applicative and appB, discarding this Applicative's result and returning appB.
      default <B> Applicative<A,​App> discardR​(Applicative<B,​App> appB)
      Sequence both this Applicative and appB, discarding appB's result and returning this Applicative.
      default <B> Applicative<B,​App> fmap​(Fn1<? super A,​? extends B> fn)
      Covariantly transmute this functor's parameter using the given mapping function.
      default <B> Lazy<? extends Applicative<B,​App>> lazyZip​(Lazy<? extends Applicative<Fn1<? super A,​? extends B>,​App>> lazyAppFn)
      Given a lazy instance of this applicative over a mapping function, "zip" the two instances together using whatever application semantics the current applicative supports.
      <B> Applicative<B,​App> pure​(B b)
      Lift the value b into this applicative functor.
      <B> Applicative<B,​App> zip​(Applicative<Fn1<? super A,​? extends B>,​App> appFn)
      Given another instance of this applicative over a mapping function, "zip" the two instances together using whatever application semantics the current applicative supports.
      • Methods inherited from interface com.jnape.palatable.lambda.functor.Functor

        coerce
    • Method Detail

      • pure

        <B> Applicative<B,​App> pure​(B b)
        Lift the value b into this applicative functor.
        Type Parameters:
        B - the type of the returned applicative's parameter
        Parameters:
        b - the value
        Returns:
        an instance of this applicative over b
      • zip

        <B> Applicative<B,​App> zip​(Applicative<Fn1<? super A,​? extends B>,​App> appFn)
        Given another instance of this applicative over a mapping function, "zip" the two instances together using whatever application semantics the current applicative supports.
        Type Parameters:
        B - the resulting applicative parameter type
        Parameters:
        appFn - the other applicative instance
        Returns:
        the mapped applicative
      • lazyZip

        default <B> Lazy<? extends Applicative<B,​App>> lazyZip​(Lazy<? extends Applicative<Fn1<? super A,​? extends B>,​App>> lazyAppFn)
        Given a lazy instance of this applicative over a mapping function, "zip" the two instances together using whatever application semantics the current applicative supports. This is useful for applicatives that support lazy evaluation and early termination.
        Type Parameters:
        B - the resulting applicative parameter type
        Parameters:
        lazyAppFn - the lazy other applicative instance
        Returns:
        the mapped applicative
        See Also:
        Maybe, Either
      • discardL

        default <B> Applicative<B,​App> discardL​(Applicative<B,​App> appB)
        Sequence both this Applicative and appB, discarding this Applicative's result and returning appB. This is generally useful for sequentially performing side-effects.
        Type Parameters:
        B - the type of the returned Applicative's parameter
        Parameters:
        appB - the other Applicative
        Returns:
        appB
      • discardR

        default <B> Applicative<A,​App> discardR​(Applicative<B,​App> appB)
        Sequence both this Applicative and appB, discarding appB's result and returning this Applicative. This is generally useful for sequentially performing side-effects.
        Type Parameters:
        B - the type of appB's parameter
        Parameters:
        appB - the other Applicative
        Returns:
        this Applicative
      • fmap

        default <B> Applicative<B,​App> 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,​App extends Applicative<?,​App>>
        Type Parameters:
        B - the new parameter type
        Parameters:
        fn - the mapping function
        Returns:
        a functor over B (the new parameter type)