All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.aya.guest0x0.syntax.Decl Maven / Gradle / Ivy

package org.aya.guest0x0.syntax;

import kala.collection.immutable.ImmutableSeq;
import org.aya.guest0x0.util.Param;
import org.jetbrains.annotations.NotNull;

/**
 * Concrete syntax of global definitions.
 */
public sealed interface Decl {
  record Tele(@NotNull ImmutableSeq> scope) {
  }
  @NotNull DefVar name();
  @NotNull Tele tele();
  record Fn(
    @Override @NotNull DefVar name,
    @Override @NotNull Tele tele,
    @NotNull Expr result,
    @NotNull Expr body
  ) implements Decl {}
  record Print(
    @Override @NotNull Tele tele,
    @NotNull Expr result,
    @NotNull Expr body
  ) implements Decl {
    @Override public @NotNull DefVar name() {
      throw new UnsupportedOperationException();
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy