java.lang.Object
java.lang.Record
org.aya.core.term.ClassCall
- All Implemented Interfaces:
Formation,StableWHNF,Term,AyaDocile,org.aya.guest0x0.cubical.Restr.TermLike<Term>
public record ClassCall(@NotNull DefVar<ClassDef,ClassDecl> ref, int ulift, @NotNull kala.collection.immutable.ImmutableMap<DefVar<MemberDef,TeleDecl.ClassMember>,org.aya.util.Arg<Term>> args)
extends Record
implements StableWHNF, Formation
ClassCall is a very special construction in Aya.
- It is like a type when partially instantiated -- the type of "specifications" of the rest of the fields.
- It is like a term when fully instantiated, whose type can be anything.
- It can be applied like a function, which essentially inserts the nearest missing field.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.aya.guest0x0.cubical.Restr.TermLike
org.aya.guest0x0.cubical.Restr.TermLike.Factory<T>Nested classes/interfaces inherited from interface org.aya.core.term.Term
Term.Matching, Term.Param -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull kala.control.Result<ClassCall,org.aya.util.reporter.Problem> addMember(Expr.Field<Expr> member, @NotNull ExprTycker tycker) @NotNull ClassCalladdMember(@NotNull ExprTycker tycker, @NotNull MemberDef member, Expr expr) @NotNull kala.collection.immutable.ImmutableMap<DefVar<MemberDef,TeleDecl.ClassMember>, org.aya.util.Arg<Term>> args()Returns the value of theargsrecord component.@NotNull ClassCalldescent(@NotNull UnaryOperator<@NotNull Term> f, @NotNull UnaryOperator<Pat> g) Descending an operation to the term AST.final booleanIndicates whether some other object is "equal to" this one.@NotNull SubstfieldSubst(@Nullable MemberDef member) final inthashCode()Returns a hash code value for this object.booleaninstantiated(@NotNull MemberDef member) @NotNull kala.collection.SeqView<MemberDef>@NotNull kala.collection.immutable.ImmutableSeq<org.aya.util.Arg<Term>>must be called after checkingsameApply(ClassCall)if the return value is used in comparator.ref()Returns the value of therefrecord component.booleanfinal StringtoString()Returns a string representation of this record class.intulift()Returns the value of theuliftrecord component.@NotNull ClassCallupdate(@NotNull kala.collection.immutable.ImmutableSeq<kala.tuple.Tuple2<DefVar<MemberDef, TeleDecl.ClassMember>, org.aya.util.Arg<Term>>> args) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.aya.generic.AyaDocile
debuggerOnlyToDocMethods inherited from interface org.aya.guest0x0.cubical.Restr.TermLike
asFormulaMethods inherited from interface org.aya.core.term.Term
computeType, findUsages, freezeHoles, lift, normalize, rename, scopeCheck, subst, subst, subst, subst, toDoc
-
Constructor Details
-
ClassCall
public ClassCall(@NotNull @NotNull DefVar<ClassDef, ClassDecl> ref, int ulift, @NotNull @NotNull kala.collection.immutable.ImmutableMap<DefVar<MemberDef, TeleDecl.ClassMember>, org.aya.util.Arg<Term>> args) Creates an instance of aClassCallrecord class.- Parameters:
ref- the value for therefrecord componentulift- the value for theuliftrecord componentargs- the value for theargsrecord component
-
-
Method Details
-
fieldSubst
-
missingMembers
-
instantiated
-
sameApply
- Returns:
- true if these two calls have same members applied
-
orderedArgs
@NotNull public @NotNull kala.collection.immutable.ImmutableSeq<org.aya.util.Arg<Term>> orderedArgs()must be called after checkingsameApply(ClassCall)if the return value is used in comparator. -
addMember
@NotNull public @NotNull kala.control.Result<ClassCall,org.aya.util.reporter.Problem> addMember(@NotNull Expr.Field<Expr> member, @NotNull @NotNull ExprTycker tycker) -
addMember
@NotNull public @NotNull ClassCall addMember(@NotNull @NotNull ExprTycker tycker, @NotNull @NotNull MemberDef member, Expr expr) -
update
@NotNull public @NotNull ClassCall update(@NotNull @NotNull kala.collection.immutable.ImmutableSeq<kala.tuple.Tuple2<DefVar<MemberDef, TeleDecl.ClassMember>, org.aya.util.Arg<Term>>> args) -
descent
@NotNull public @NotNull ClassCall descent(@NotNull @NotNull UnaryOperator<@NotNull Term> f, @NotNull @NotNull UnaryOperator<Pat> g) Description copied from interface:TermDescending an operation to the term AST. NOTE: Currently we require the operation `f` to preserve:,invalid @link
StructCallDataCall,SortTerm,Shaped.Applicable. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
ref
Returns the value of therefrecord component.- Returns:
- the value of the
refrecord component
-
ulift
public int ulift()Returns the value of theuliftrecord component.- Returns:
- the value of the
uliftrecord component
-
args
@NotNull public @NotNull kala.collection.immutable.ImmutableMap<DefVar<MemberDef,TeleDecl.ClassMember>, args()org.aya.util.Arg<Term>> Returns the value of theargsrecord component.- Returns:
- the value of the
argsrecord component
-