diff options
author | Nadrieril | 2019-04-06 23:07:30 +0200 |
---|---|---|
committer | Nadrieril | 2019-04-06 23:07:30 +0200 |
commit | b0eb080caab28196a09c5b60c5b6556846732563 (patch) | |
tree | 28b723af613a6761037f3ecc50075a6e29bb7717 /dhall/src/expr.rs | |
parent | f93aee4dcf71c85b826244b3b57949ffbdb820c4 (diff) |
Store the whole type hierarchy in a Type
Diffstat (limited to 'dhall/src/expr.rs')
-rw-r--r-- | dhall/src/expr.rs | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/dhall/src/expr.rs b/dhall/src/expr.rs index 831fbc5..ad35645 100644 --- a/dhall/src/expr.rs +++ b/dhall/src/expr.rs @@ -10,9 +10,14 @@ pub struct Resolved(pub(crate) SubExpr<X, X>); #[derive(Debug, Clone)] pub struct Typed(pub(crate) SubExpr<X, X>, pub(crate) Type); -// #[derive(Debug, Clone)] -// pub struct Type(pub(crate) Box<Normalized>); -pub type Type = SubExpr<X, X>; +#[derive(Debug, Clone)] +pub struct Type(pub(crate) TypeInternal); + +#[derive(Debug, Clone)] +pub(crate) enum TypeInternal { + Expr(Box<Normalized>), + Universe(usize), +} #[derive(Debug, Clone)] pub struct Normalized(pub(crate) SubExpr<X, X>, pub(crate) Type); @@ -27,9 +32,3 @@ impl std::fmt::Display for Parsed { self.0.fmt(f) } } - -// impl Type { -// pub fn as_expr(&self) -> &Normalized { -// &*self.0 -// } -// } |