From 55b5be3407a8528bc47482a591b168a7cb0ce91e Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Mon, 6 May 2019 23:52:15 +0200 Subject: Move main datatypes into their own modules --- dhall/src/core/value.rs | 616 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 616 insertions(+) create mode 100644 dhall/src/core/value.rs (limited to 'dhall/src/core/value.rs') diff --git a/dhall/src/core/value.rs b/dhall/src/core/value.rs new file mode 100644 index 0000000..31193d2 --- /dev/null +++ b/dhall/src/core/value.rs @@ -0,0 +1,616 @@ +use std::collections::BTreeMap; + +use dhall_proc_macros as dhall; +use dhall_syntax::{ + rc, Builtin, Const, ExprF, Integer, InterpolatedTextContents, Label, + Natural, V, X, +}; + +use crate::core::thunk::{Thunk, TypeThunk}; +use crate::phase::normalize::{ + apply_builtin, normalize_one_layer, squash_textlit, OutputSubExpr, +}; +use crate::phase::Typed; + +/// Stores a pair of variables: a normal one and if relevant one +/// that corresponds to the alpha-normalized version of the first one. +/// Equality is up to alpha-equivalence. +#[derive(Debug, Clone, Eq)] +pub(crate) struct AlphaVar { + normal: V