public final class V3<A>
extends java.lang.Object
implements java.lang.Iterable<A>
Modifier and Type | Method and Description |
---|---|
static <A> F<V3<A>,A> |
__1()
A first-class function to get the first element of a vector.
|
static <A> F<V3<A>,A> |
__2()
A first-class function to get the second element of a vector.
|
static <A> F<V3<A>,A> |
__3()
A first-class function to get the third element of a vector.
|
A |
_1()
Returns the first element of this vector.
|
A |
_2()
Returns the second element of this vector.
|
A |
_3()
Returns the third element of this vector.
|
<B> V3<B> |
apply(V3<F<A,B>> vf)
Performs function application within a vector (applicative functor pattern).
|
static <A> V3<A> |
cons(P1<A> head,
V2<A> tail)
Creates a vector-3 from a head and a tail.
|
P1<A> |
head()
Returns the first element of this vector, as a product-1.
|
java.util.Iterator<A> |
iterator()
Returns an iterator for the elements of this vector.
|
<B> V3<B> |
map(F<A,B> f)
Maps the given function across this vector.
|
static <A> F<V3<A>,P3<A,A,A>> |
p_()
Returns a function that transforms a vector-3 to the equivalent product-3.
|
P3<A,A,A> |
p()
Returns a homogeneous product-3 equivalent to this vector.
|
static <A> V3<A> |
p(P3<A,A,A> p)
Creates a vector-3 from a homogeneous product-3.
|
V2<A> |
tail()
Returns all but the first element of this vector, as a vector-2.
|
Array<A> |
toArray()
Returns an array with the elements of this vector.
|
NonEmptyList<A> |
toNonEmptyList()
Returns a nonempty list with the elements of this vector.
|
static <A> F<V3<A>,Stream<A>> |
toStream_()
Returns a function that transforms a vector-3 to a stream of its elements.
|
Stream<A> |
toStream()
Returns a stream of the elements of this vector.
|
V3<V2<A>> |
vzip(V3<A> bs)
Zips this vector with the given vector to produce a vector of vectors.
|
<B> V3<P2<A,B>> |
zip(V3<B> bs)
Zips this vector with the given vector to produce a vector of pairs.
|
<B,C> V3<C> |
zipWith(F<A,F<B,C>> f,
V3<B> bs)
Zips this vector with the given vector using the given function to produce a new vector.
|
public static <A> V3<A> p(P3<A,A,A> p)
p
- The product-3 from which to create a vector.public static <A> V3<A> cons(P1<A> head, V2<A> tail)
head
- The value to put as the first element of the vector.tail
- The vector representing all but the first element of the new vector.public A _1()
public A _2()
public A _3()
public V2<A> tail()
public P1<A> head()
public P3<A,A,A> p()
public Array<A> toArray()
public <B> V3<B> apply(V3<F<A,B>> vf)
vf
- The vector of functions to apply.public <B,C> V3<C> zipWith(F<A,F<B,C>> f, V3<B> bs)
bs
- The vector to zip this vector with.f
- The function to zip this vector and the given vector with.public <B> V3<P2<A,B>> zip(V3<B> bs)
bs
- The vector to zip this vector with.public V3<V2<A>> vzip(V3<A> bs)
bs
- The vector to zip this vector with.public java.util.Iterator<A> iterator()
iterator
in interface java.lang.Iterable<A>
public NonEmptyList<A> toNonEmptyList()
public Stream<A> toStream()
public <B> V3<B> map(F<A,B> f)
f
- The function to map across this vector.public static <A> F<V3<A>,Stream<A>> toStream_()
public static <A> F<V3<A>,P3<A,A,A>> p_()
public static <A> F<V3<A>,A> __1()
public static <A> F<V3<A>,A> __2()