From 78e9e32e1357d50313287dd2a3c437132c83aeb6 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 15 Dec 2019 20:10:54 +0000 Subject: Move contents of dhall_syntax to dhall --- dhall_syntax/src/core/expr.rs | 377 ------------------------------------------ 1 file changed, 377 deletions(-) delete mode 100644 dhall_syntax/src/core/expr.rs (limited to 'dhall_syntax/src/core/expr.rs') diff --git a/dhall_syntax/src/core/expr.rs b/dhall_syntax/src/core/expr.rs deleted file mode 100644 index 131f97e..0000000 --- a/dhall_syntax/src/core/expr.rs +++ /dev/null @@ -1,377 +0,0 @@ -use crate::map::{DupTreeMap, DupTreeSet}; -use crate::visitor::{self, ExprFMutVisitor, ExprFVisitor}; -use crate::*; - -pub type Integer = isize; -pub type Natural = usize; -pub type Double = NaiveDouble; - -pub fn trivial_result(x: Result) -> T { - match x { - Ok(x) => x, - Err(e) => e, - } -} - -/// Double with bitwise equality -#[derive(Debug, Copy, Clone)] -pub struct NaiveDouble(f64); - -impl PartialEq for NaiveDouble { - fn eq(&self, other: &Self) -> bool { - self.0.to_bits() == other.0.to_bits() - } -} - -impl Eq for NaiveDouble {} - -impl std::hash::Hash for NaiveDouble { - fn hash(&self, state: &mut H) - where - H: std::hash::Hasher, - { - self.0.to_bits().hash(state) - } -} - -impl From for NaiveDouble { - fn from(x: f64) -> Self { - NaiveDouble(x) - } -} - -impl From for f64 { - fn from(x: NaiveDouble) -> f64 { - x.0 - } -} - -/// Constants for a pure type system -#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] -pub enum Const { - Type, - Kind, - Sort, -} - -/// Bound variable -/// -/// The `Label` field is the variable's name (i.e. \"`x`\"). -/// The `Int` field is a DeBruijn index. -/// See dhall-lang/standard/semantics.md for details -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct V