Skip to content

Commit

Permalink
misc: add some rubbish
Browse files Browse the repository at this point in the history
  • Loading branch information
HoshinoTented committed Jun 26, 2024
1 parent 76ea37d commit ea356a9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions syntax/src/main/java/org/aya/syntax/telescope/AbstractTele.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,19 @@ record Locns(@NotNull ImmutableSeq<Param> telescope, @NotNull Term result) imple
assert count <= telescopeSize();
return new Locns(telescope.drop(count), result);
}

@Override
public @NotNull Locns inst(ImmutableSeq<Term> preArgs) {
if (preArgs.isEmpty()) return this;
assert preArgs.size() <= telescopeSize();
var view = preArgs.view();
var cope = telescope.view()
.drop(preArgs.size())
.mapIndexed((idx, p) -> p.descent(t -> t.replaceTeleFrom(idx, view)))
.toImmutableSeq();
var result = this.result.replaceTeleFrom(cope.size(), view);
return new Locns(cope, result);
}
}

record Lift(
Expand Down

0 comments on commit ea356a9

Please sign in to comment.