public interface TypeTemplate
Modifier and Type | Method and Description |
---|---|
TypeFamily |
apply(TypeFamily family) |
<A,B> FamilyOptic<A,B> |
applyO(FamilyOptic<A,B> input,
Type<A> aType,
Type<B> bType) |
<A,B> (TypeTemplate|Type.FieldNotFoundException) |
findFieldOrType(int index,
String name,
Type<A> type,
Type<B> resultType)
returned optic will accept
template<family<index>> with the input template, and will return the same with the returned template. |
(int) -> RewriteResult<?,?> |
hmap(TypeFamily family,
(int) -> RewriteResult<?,?> function)
constraint: family, argFamily and resFamily are matched.
|
int |
size() |
default Type<?> |
toSimpleType() |
int size()
TypeFamily apply(TypeFamily family)
default Type<?> toSimpleType()
<A,B> (TypeTemplate|Type.FieldNotFoundException) findFieldOrType(int index, @Nullable String name, Type<A> type, Type<B> resultType)
template<family<index>>
with the input template, and will return the same with the returned template.
(template, optic) = Left(result)
this.apply(family).apply(index) == optic.sType
template.apply(family).apply(index) == optic.tType
(int) -> RewriteResult<?,?> hmap(TypeFamily family, (int) -> RewriteResult<?,?> function)
result.function(i) :: this.apply(function.argFamily()).apply(i) -> this.apply(function.resFamily()).apply(i)
<A,B> FamilyOptic<A,B> applyO(FamilyOptic<A,B> input, Type<A> aType, Type<B> bType)