org.aya.util.tyck.pat.PatClass Maven / Gradle / Ivy
// Copyright (c) 2020-2023 Tesla (Yinsen) Zhang.
// Use of this source code is governed by the MIT license that can be found in the LICENSE.md file.
package org.aya.util.tyck.pat;
import kala.collection.immutable.ImmutableSeq;
import kala.collection.immutable.primitive.ImmutableIntSeq;
import org.jetbrains.annotations.NotNull;
import java.util.function.Function;
public record PatClass(@NotNull T term, @NotNull ImmutableIntSeq cls) {
public @NotNull PatClass map(Function f) {
return new PatClass<>(f.apply(term), cls);
}
public @NotNull ImmutableSeq
extract(@NotNull ImmutableSeq
seq) {
return cls.mapToObj(seq::get);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy