Module aya.base
Package org.aya.generic
Interface Nested<Param,Term,This extends Nested<Param,Term,This>>
- All Known Implementing Classes:
Expr.Lambda,Expr.Let,Expr.Pi
public interface Nested<Param,Term,This extends Nested<Param,Term,This>>
A Nested structure is something consists of a head and a body, for example:
Expr.Lambdais a nested structure, it has aExpr.Paramas a head and aExpras a bodyExpr.Letis a nested structure, it has aExpr.LetBindas a head and aExpras a body- If you wish,
Expr.Appis also a nested structure in some way
A Nested class is supposed to also be a Nested
-
Method Summary
Modifier and TypeMethodDescriptionbody()The body of a nested structurestatic <Param,Term, This extends Nested<Param, Term, This>>
@NotNull kala.tuple.Tuple2<kala.collection.immutable.ImmutableSeq<Param>,Term> destructNested(This nested) param()The head of a nested structure.default ThisThe nested body of a nested structure
-
Method Details
-
param
The head of a nested structure. It looks like a parameter of a lambda expression, so I call it "param". -
body
The body of a nested structure -
tryNested
The nested body of a nested structure- Returns:
- null if the body is not
Nested - Implementation Requirements:
tryNested == null || tryNested == body
-
destructNested
@NotNull static <Param,Term, @NotNull kala.tuple.Tuple2<kala.collection.immutable.ImmutableSeq<Param>,This extends Nested<Param, Term, This>> Term> destructNested(@NotNull This nested)
-