From 74e25dbf678196cd6b1e91d9ae83f445efaad2e2 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Fri, 12 Apr 2019 18:00:06 +0200 Subject: Remove any remains from the standard or `dhall-haskell` --- dhall/src/typecheck.rs | 4 +- dhall_core/src/core.rs | 171 ++++++++----------------------------------------- 2 files changed, 28 insertions(+), 147 deletions(-) diff --git a/dhall/src/typecheck.rs b/dhall/src/typecheck.rs index 5a28089..e854927 100644 --- a/dhall/src/typecheck.rs +++ b/dhall/src/typecheck.rs @@ -304,8 +304,8 @@ macro_rules! ensure_is_const { }; } -/// Type-check an expression and return the expression alongside its type -/// if type-checking succeeded, or an error if type-checking failed +/// Type-check an expression and return the expression alongside its type if type-checking +/// succeeded, or an error if type-checking failed pub fn type_with( ctx: &Context>, e: SubExpr>, diff --git a/dhall_core/src/core.rs b/dhall_core/src/core.rs index 5b138b8..2eb8980 100644 --- a/dhall_core/src/core.rs +++ b/dhall_core/src/core.rs @@ -43,26 +43,6 @@ impl From for f64 { } /// Constants for a pure type system -/// -/// The only axiom is: -/// -/// ```c -/// ⊦ Type : Kind -/// ``` -/// -/// ... and the valid rule pairs are: -/// -/// ```c -/// ⊦ Type ↝ Type : Type -- Functions from terms to terms (ordinary functions) -/// ⊦ Kind ↝ Type : Type -- Functions from types to terms (polymorphic functions) -/// ⊦ Kind ↝ Kind : Kind -- Functions from types to types (type constructors) -/// ``` -/// -/// These are the same rule pairs as System Fω -/// -/// Note that Dhall does not support functions from terms to types and therefore -/// Dhall is not a dependently typed language -/// #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum Const { Type, @@ -73,39 +53,8 @@ pub enum Const { /// Bound variable /// /// The `Label` field is the variable's name (i.e. \"`x`\"). -/// -/// The `Int` field disambiguates variables with the same name if there are -/// multiple bound variables of the same name in scope. Zero refers to the -/// nearest bound variable and the index increases by one for each bound -/// variable of the same name going outward. The following diagram may help: -/// -/// ```c -/// +---refers to--+ -/// | | -/// v | -/// \(x : Type) -> \(y : Type) -> \(x : Type) -> x@0 -/// -/// +------------------refers to-----------------+ -/// | | -/// v | -/// \(x : Type) -> \(y : Type) -> \(x : Type) -> x@1 -/// ``` -/// -/// This `Int` behaves like a De Bruijn index in the special case where all -/// variables have the same name. -/// -/// You can optionally omit the index if it is `0`: -/// -/// ```c -/// +refers to+ -/// | | -/// v | -/// \(x : *) -> \(y : *) -> \(x : *) -> x -/// ``` -/// -/// Zero indices are omitted when pretty-printing `Var`s and non-zero indices -/// appear as a numeric suffix. -/// +/// The `Int` field is a DeBruijn index. +/// See dhall-lang/standard/semantics.md for details #[derive(Debug, Clone, PartialEq, Eq)] pub struct V