Class First<A>

    • Field Detail

      • INSTANCE

        private static final First<?> INSTANCE
    • Constructor Detail

      • First

        private First()
    • Method Detail

      • identity

        public Maybe<A> identity()
        Description copied from interface: Monoid
        The identity element of this monoid.
        Specified by:
        identity in interface Monoid<A>
        Returns:
        the identity
      • foldMap

        public <B> Maybe<A> foldMap​(Fn1<? super B,​? extends Maybe<A>> fn,
                                    java.lang.Iterable<B> bs)
        Description copied from interface: Monoid
        Homomorphism combined with catamorphism. Convert an Iterable<B> to an Iterable<A> (that is, an Iterable of elements this monoid is formed over), then reduce the result from left to right. Under algebraic data types, this is isomorphic to a flatMap.
        Specified by:
        foldMap in interface Monoid<A>
        Type Parameters:
        B - the input Iterable element type
        Parameters:
        fn - the mapping function from A to B
        bs - the Iterable of Bs
        Returns:
        the folded result under this Monoid
        See Also:
        Map, Monoid.reduceLeft(Iterable)
      • first

        public static <A> First<A> first()