[−][src]Enum voile::syntax::core::Val
Non-redex, canonical values.
Variants
Type(Level)
Type universe.
Lam(Closure)
Closure with parameter typed.
For untyped closures, it can be represented as Neut
directly.
Dt(DtKind, Box<Self>, Closure)
Pi-like types (dependent types), with parameter explicitly typed.
Sum(Variants)
Sum type literal.
Cons(String, Box<Self>)
Constructor invocation.
Pair(Box<Self>, Box<Self>)
Sigma instance.
Neut(Neutral)
Methods
impl Val
[src]
pub fn apply(self, arg: Val) -> Val
[src]
$$
\newcommand{\inst}[0]{\texttt{inst}}
\newcommand{\app}[0]{\texttt{app}}
\begin{alignedat}{1}
\app(\lambda C, o) &= \inst(C, o) \
\app([k], o) &= [k\ o]
\end{alignedat}
$$
Just for evaluation during beta-reduction.
pub fn first(self) -> Val
[src]
$$
\newcommand{\first}[0]{\texttt{first}}
\newcommand{\second}[0]{\texttt{second}}
\begin{alignedat}{1}
\first(n, m) &= n \
\first([k]) &= [k\ .1] \
\end{alignedat}
$$
Just for evaluation during beta-reduction.
pub fn second(self) -> Val
[src]
\newcommand{\first}[0]{\texttt{first}}
\newcommand{\second}[0]{\texttt{second}}
\begin{alignedat}{1}
\second(n, m) &= m \
\second([k]) &= [k\ .2]
\end{alignedat}
Just for evaluation during beta-reduction.
pub(crate) fn attach_dbi(self, dbi: DBI) -> Self
[src]
impl Val
[src]
pub fn is_type(&self) -> bool
[src]
pub fn is_universe(&self) -> bool
[src]
pub fn try_into_sum(self) -> Result<Variants, Self>
[src]
pub fn pair(first: Self, second: Self) -> Self
[src]
pub fn cons(name: String, param: Self) -> Self
[src]
pub fn lift(levels: u32, expr: Neutral) -> Self
[src]
pub fn var(index: DBI) -> Self
[src]
pub fn lam(body: Self) -> Self
[src]
pub fn bot() -> TVal
[src]
pub fn glob(index: DBI) -> Self
[src]
pub fn axiom() -> Self
[src]
pub(crate) fn postulate(uid: UID) -> Self
[src]
pub(crate) fn generate(uid: UID, dbi: DBI) -> Self
[src]
pub fn unimplemented(dbi: DBI) -> Self
[src]
pub fn app(function: Neutral, arg: Self) -> Self
[src]
pub fn fst(pair: Neutral) -> Self
[src]
pub fn snd(pair: Neutral) -> Self
[src]
pub fn dependent_type(kind: DtKind, param_type: TVal, body: TVal) -> TVal
[src]
pub fn pi(param_type: TVal, body: TVal) -> TVal
[src]
pub fn sig(param_type: TVal, body: TVal) -> TVal
[src]
pub fn into_neutral(self) -> Result<Neutral, Self>
[src]
pub fn map_neutral<F: Fn(Neutral) -> Self + Copy>(self, f: F) -> Self
[src]
impl Val
[src]
pub fn into_info(self, syntax_info: SyntaxInfo) -> ValInfo
[src]
Trait Implementations
impl RedEx for Val
[src]
fn reduce_with_dbi(self, arg: Val, dbi: DBI) -> Val
[src]
impl AxiomEx for Val
[src]
fn generated_to_var(self) -> Self
[src]
fn unimplemented_to_glob(self) -> Self
[src]
impl LiftEx for Val
[src]
fn lift(self, levels: u32) -> Val
[src]
fn calc_level(&self) -> Option<Level>
[src]
fn level(&self) -> Level
[src]
Calculate the level of self
, like a normal value will have level 0, a type expression will have level 1 (or higher). Read more
impl Eq for Val
[src]
fn assert_receiver_is_total_eq(&self)
[src]
impl Clone for Val
[src]
fn clone(&self) -> Val
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq<Val> for Val
[src]
impl Default for Val
[src]
impl Display for Val
[src]
impl Debug for Val
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,