flat encoding for list and pairs

Co-authored-by: rvcas <x@rvcas.dev>
This commit is contained in:
Kasey White
2022-08-04 02:36:39 -04:00
committed by Lucas
parent 198dae7f5d
commit d14920265e
8 changed files with 187 additions and 47 deletions

View File

@@ -1,8 +1,6 @@
use std::fmt::Display;
use thiserror::Error;
use crate::ast::{NamedDeBruijn, Term};
use crate::ast::{NamedDeBruijn, Term, Type};
use super::{ExBudget, Value};
@@ -31,24 +29,3 @@ pub enum Error {
#[error("The evaluation never reached a final state")]
MachineNeverReachedDone,
}
#[derive(Debug, Clone, PartialEq)]
pub enum Type {
Bool,
Integer,
String,
ByteString,
Unit,
}
impl Display for Type {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Type::Bool => write!(f, "bool"),
Type::Integer => write!(f, "integer"),
Type::String => write!(f, "string"),
Type::ByteString => write!(f, "bytestring"),
Type::Unit => write!(f, "unit"),
}
}
}

View File

@@ -1,8 +1,10 @@
use crate::{ast::Constant, builtins::DefaultFunction};
use crate::{
ast::{Constant, Type},
builtins::DefaultFunction,
};
use super::{
cost_model::{BuiltinCosts, ExBudget},
error::Type,
Error, Value,
};