org.aya.guest0x0.syntax.Def Maven / Gradle / Ivy
package org.aya.guest0x0.syntax;
import kala.collection.immutable.ImmutableSeq;
import org.aya.guest0x0.util.Param;
import org.jetbrains.annotations.NotNull;
public sealed interface Def extends FnLike {
@NotNull DefVar extends Def> name();
record Fn(
@Override @NotNull DefVar name,
@Override @NotNull ImmutableSeq> telescope,
@NotNull Term result,
@NotNull Term body
) implements Def {
public Fn {
name.core = this;
}
}
/**
* For (maybe mutually) recursive definitions, like types and functions
*
* @param isData it will be a function if false
*/
record Signature(
boolean isData,
@Override @NotNull ImmutableSeq> telescope,
@NotNull Term result
) implements FnLike {
}
record Print(
@Override @NotNull ImmutableSeq> telescope,
@NotNull Term result,
@NotNull Term body
) implements Def {
@Override public @NotNull DefVar extends Print> name() {
throw new UnsupportedOperationException();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy