Class Concat<A>
- java.lang.Object
-
- com.jnape.palatable.lambda.monoid.builtin.Concat<A>
-
- All Implemented Interfaces:
Fn1<java.lang.Iterable<A>,Fn1<java.lang.Iterable<A>,java.lang.Iterable<A>>>
,Fn2<java.lang.Iterable<A>,java.lang.Iterable<A>,java.lang.Iterable<A>>
,Applicative<Fn1<java.lang.Iterable<A>,java.lang.Iterable<A>>,Fn1<java.lang.Iterable<A>,?>>
,Cartesian<java.lang.Iterable<A>,Fn1<java.lang.Iterable<A>,java.lang.Iterable<A>>,Fn1<?,?>>
,Cocartesian<java.lang.Iterable<A>,Fn1<java.lang.Iterable<A>,java.lang.Iterable<A>>,Fn1<?,?>>
,Contravariant<java.lang.Iterable<A>,Profunctor<?,Fn1<java.lang.Iterable<A>,java.lang.Iterable<A>>,Fn1<?,?>>>
,Functor<Fn1<java.lang.Iterable<A>,java.lang.Iterable<A>>,Fn1<java.lang.Iterable<A>,?>>
,Profunctor<java.lang.Iterable<A>,Fn1<java.lang.Iterable<A>,java.lang.Iterable<A>>,Fn1<?,?>>
,Monad<Fn1<java.lang.Iterable<A>,java.lang.Iterable<A>>,Fn1<java.lang.Iterable<A>,?>>
,MonadReader<java.lang.Iterable<A>,Fn1<java.lang.Iterable<A>,java.lang.Iterable<A>>,Fn1<java.lang.Iterable<A>,?>>
,MonadRec<Fn1<java.lang.Iterable<A>,java.lang.Iterable<A>>,Fn1<java.lang.Iterable<A>,?>>
,MonadWriter<java.lang.Iterable<A>,Fn1<java.lang.Iterable<A>,java.lang.Iterable<A>>,Fn1<java.lang.Iterable<A>,?>>
,Monoid<java.lang.Iterable<A>>
,Semigroup<java.lang.Iterable<A>>
public final class Concat<A> extends java.lang.Object implements Monoid<java.lang.Iterable<A>>
TheMonoid
instance formed under concatenation for an arbitraryIterable
.- See Also:
Monoid
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Concat()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Iterable<A>
checkedApply(java.lang.Iterable<A> xs, java.lang.Iterable<A> ys)
static <A> Concat<A>
concat()
static <A> Fn1<java.lang.Iterable<A>,java.lang.Iterable<A>>
concat(java.lang.Iterable<A> xs)
static <A> java.lang.Iterable<A>
concat(java.lang.Iterable<A> xs, java.lang.Iterable<A> ys)
<B> java.lang.Iterable<A>
foldMap(Fn1<? super B,? extends java.lang.Iterable<A>> fn, java.lang.Iterable<B> bs)
Homomorphism combined with catamorphism.java.lang.Iterable<A>
identity()
The identity element of this monoid.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.jnape.palatable.lambda.functions.Fn1
andThen, carry, cartesian, censor, choose, cocartesian, diMap, diMapR, discardL, flatMap, fmap, lazyZip, listens, local, pure, self, thunk, toFunction, trampolineM, zip, zip
-
Methods inherited from interface com.jnape.palatable.lambda.functions.Fn2
apply, apply, checkedApply, compose, contraMap, diMapL, discardR, toBiFunction, uncurry, widen
-
Methods inherited from interface com.jnape.palatable.lambda.monoid.Monoid
flip, foldLeft, foldRight, reduceLeft, reduceRight
-
-
-
-
Field Detail
-
INSTANCE
private static final Concat<?> INSTANCE
-
-
Method Detail
-
identity
public java.lang.Iterable<A> identity()
Description copied from interface:Monoid
The identity element of this monoid.
-
checkedApply
public java.lang.Iterable<A> checkedApply(java.lang.Iterable<A> xs, java.lang.Iterable<A> ys)
- Specified by:
checkedApply
in interfaceFn2<java.lang.Iterable<A>,java.lang.Iterable<A>,java.lang.Iterable<A>>
-
foldMap
public <B> java.lang.Iterable<A> foldMap(Fn1<? super B,? extends java.lang.Iterable<A>> fn, java.lang.Iterable<B> bs)
Description copied from interface:Monoid
Homomorphism combined with catamorphism. Convert anIterable<B>
to anIterable<A>
(that is, anIterable
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 interfaceMonoid<A>
- Type Parameters:
B
- the input Iterable element type- Parameters:
fn
- the mapping function from A to Bbs
- the Iterable of Bs- Returns:
- the folded result under this Monoid
- See Also:
Map
,Monoid.reduceLeft(Iterable)
-
concat
public static <A> Concat<A> concat()
-
concat
public static <A> Fn1<java.lang.Iterable<A>,java.lang.Iterable<A>> concat(java.lang.Iterable<A> xs)
-
concat
public static <A> java.lang.Iterable<A> concat(java.lang.Iterable<A> xs, java.lang.Iterable<A> ys)
-
-