Interface MonadWriter<W,​A,​MW extends MonadWriter<W,​?,​MW>>

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      MonadWriter<W,​A,​MW> censor​(Fn1<? super W,​? extends W> fn)
      Update the accumulated state.
      default <B> MonadWriter<W,​B,​MW> discardL​(Applicative<B,​MW> appB)
      Sequence both this Applicative and appB, discarding this Applicative's result and returning appB.
      default <B> MonadWriter<W,​A,​MW> discardR​(Applicative<B,​MW> appB)
      Sequence both this Applicative and appB, discarding appB's result and returning this Applicative.
      <B> MonadWriter<W,​B,​MW> flatMap​(Fn1<? super A,​? extends Monad<B,​MW>> f)
      Chain dependent computations that may continue or short-circuit based on previous results.
      default <B> MonadWriter<W,​B,​MW> fmap​(Fn1<? super A,​? extends B> fn)
      Covariantly transmute this functor's parameter using the given mapping function.
      default <B> Lazy<? extends MonadWriter<W,​B,​MW>> lazyZip​(Lazy<? extends Applicative<Fn1<? super A,​? extends B>,​MW>> 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> MonadWriter<W,​Tuple2<A,​B>,​MW> listens​(Fn1<? super W,​? extends B> fn)
      Map the accumulation into a value and pair it with the current output.
      <B> MonadWriter<W,​B,​MW> pure​(B b)
      Lift the value b into this applicative functor.
      default <B> MonadWriter<W,​B,​MW> zip​(Applicative<Fn1<? super A,​? extends B>,​MW> 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

      • listens

        <B> MonadWriter<W,​Tuple2<A,​B>,​MW> listens​(Fn1<? super W,​? extends B> fn)
        Map the accumulation into a value and pair it with the current output.
        Type Parameters:
        B - the mapped output
        Parameters:
        fn - the mapping function
        Returns:
        the updated MonadWriter
      • censor

        MonadWriter<W,​A,​MW> censor​(Fn1<? super W,​? extends W> fn)
        Update the accumulated state.
        Parameters:
        fn - the update function
        Returns:
        the updated MonadWriter
      • flatMap

        <B> MonadWriter<W,​B,​MW> flatMap​(Fn1<? super A,​? extends Monad<B,​MW>> f)
        Chain dependent computations that may continue or short-circuit based on previous results.
        Specified by:
        flatMap in interface Monad<W,​A>
        Type Parameters:
        B - the resulting monad parameter type
        Parameters:
        f - the dependent computation over A
        Returns:
        the new monad instance
      • pure

        <B> MonadWriter<W,​B,​MW> pure​(B b)
        Lift the value b into this applicative functor.
        Specified by:
        pure in interface Applicative<W,​A>
        Specified by:
        pure in interface Monad<W,​A>
        Type Parameters:
        B - the type of the returned applicative's parameter
        Parameters:
        b - the value
        Returns:
        an instance of this applicative over b
      • fmap

        default <B> MonadWriter<W,​B,​MW> 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 Applicative<W,​A>
        Specified by:
        fmap in interface Functor<W,​A>
        Specified by:
        fmap in interface Monad<W,​A>
        Type Parameters:
        B - the new parameter type
        Parameters:
        fn - the mapping function
        Returns:
        a functor over B (the new parameter type)
      • zip

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

        default <B> Lazy<? extends MonadWriter<W,​B,​MW>> lazyZip​(Lazy<? extends Applicative<Fn1<? super A,​? extends B>,​MW>> 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.
        Specified by:
        lazyZip in interface Applicative<W,​A>
        Specified by:
        lazyZip in interface Monad<W,​A>
        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> MonadWriter<W,​B,​MW> discardL​(Applicative<B,​MW> appB)
        Sequence both this Applicative and appB, discarding this Applicative's result and returning appB. This is generally useful for sequentially performing side-effects.
        Specified by:
        discardL in interface Applicative<W,​A>
        Specified by:
        discardL in interface Monad<W,​A>
        Type Parameters:
        B - the type of the returned Applicative's parameter
        Parameters:
        appB - the other Applicative
        Returns:
        appB
      • discardR

        default <B> MonadWriter<W,​A,​MW> discardR​(Applicative<B,​MW> appB)
        Sequence both this Applicative and appB, discarding appB's result and returning this Applicative. This is generally useful for sequentially performing side-effects.
        Specified by:
        discardR in interface Applicative<W,​A>
        Specified by:
        discardR in interface Monad<W,​A>
        Type Parameters:
        B - the type of appB's parameter
        Parameters:
        appB - the other Applicative
        Returns:
        this Applicative