Interface Functor<A,​F extends Functor<?,​F>>

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default <Concrete extends Functor<A,​F>>
      Concrete
      coerce()
      Convenience method for coercing this functor instance into another concrete type.
      <B> Functor<B,​F> fmap​(Fn1<? super A,​? extends B> fn)
      Covariantly transmute this functor's parameter using the given mapping function.
    • Method Detail

      • fmap

        <B> Functor<B,​F> 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.
        Type Parameters:
        B - the new parameter type
        Parameters:
        fn - the mapping function
        Returns:
        a functor over B (the new parameter type)
      • coerce

        default <Concrete extends Functor<A,​F>> Concrete coerce()
        Convenience method for coercing this functor instance into another concrete type. Unsafe.
        Type Parameters:
        Concrete - the concrete functor instance to coerce this functor to
        Returns:
        the coerced functor