org.aya.util.tyck.pat.Indexed 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.Seq;
import kala.collection.immutable.primitive.ImmutableIntSeq;
import org.jetbrains.annotations.NotNull;
/**
* Used in pattern classifier.
*/
public record Indexed(@NotNull Pat pat, int ix) {
public static @NotNull ImmutableIntSeq indices(@NotNull Seq extends Indexed>> cls) {
return cls.view().mapToInt(ImmutableIntSeq.factory(), Indexed::ix);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy