Class IterableLens
java.lang.Object
com.jnape.palatable.lambda.optics.lenses.IterableLens
Lenses that operate on
Iterable
s.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <A> Lens.Simple
<Iterable<A>, Maybe<A>> head()
A lens focusing on the head of a givenIterable
.static <A,
B> Iso.Simple <Iterable<A>, Iterable<B>> An iso focusing on the mapped values of anIterable
.static <A> Lens.Simple
<Iterable<A>, Iterable<A>> tail()
A lens focusing on the tail of anIterable
.
-
Constructor Details
-
IterableLens
private IterableLens()
-
-
Method Details
-
head
A lens focusing on the head of a givenIterable
.Note that this lens is effectively lawful, though difficult to prove since there is no useful equality implementation for
Iterable
.- Type Parameters:
A
- the Iterable element type- Returns:
- a lens focusing on the head element of an
Iterable
-
tail
A lens focusing on the tail of anIterable
.- Type Parameters:
A
- the Iterable element type- Returns:
- a lens focusing on the tail of an
Iterable
-
mapping
An iso focusing on the mapped values of anIterable
.
-