From 45be2ff1f5bb3d6e0faa098402adf985b3d5e7ca Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 4 May 2019 12:38:36 +0200 Subject: Rename dhall_core to dhall_syntax --- dhall_core/src/core.rs | 563 ------------------------------------------------- 1 file changed, 563 deletions(-) delete mode 100644 dhall_core/src/core.rs (limited to 'dhall_core/src/core.rs') diff --git a/dhall_core/src/core.rs b/dhall_core/src/core.rs deleted file mode 100644 index 3db07dd..0000000 --- a/dhall_core/src/core.rs +++ /dev/null @@ -1,563 +0,0 @@ -#![allow(non_snake_case)] -use std::collections::BTreeMap; -use std::collections::HashMap; -use std::rc::Rc; - -use crate::context::Context; -use crate::visitor; -use crate::*; - -pub type Integer = isize; -pub type Natural = usize; -pub type Double = NaiveDouble; - -/// An empty type -#[derive(Debug, Copy, Clone, PartialEq, Eq)] -pub enum X {} - -pub fn trivial_result(x: Result) -> T { - match x { - Ok(x) => x, - Err(e) => match 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 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)] -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)] -pub struct V