summaryrefslogtreecommitdiff
path: root/dhall/src/expr.rs
diff options
context:
space:
mode:
authorNadrieril2019-04-13 00:44:58 +0200
committerNadrieril2019-04-13 00:44:58 +0200
commite7e79bf32c385fa8c30a45be262ca3d6d8f1f653 (patch)
tree769651e0c22c9d15069f8fee24c82a3eecfb1f1d /dhall/src/expr.rs
parentca0939f4cdf373ca735f25926d0a02c698d7f1cf (diff)
Document all of the API
Closes #64
Diffstat (limited to 'dhall/src/expr.rs')
-rw-r--r--dhall/src/expr.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/dhall/src/expr.rs b/dhall/src/expr.rs
index 6f9f280..a84b41d 100644
--- a/dhall/src/expr.rs
+++ b/dhall/src/expr.rs
@@ -50,7 +50,12 @@ pub(crate) struct Normalized<'a>(
);
derive_other_traits!(Normalized);
-/// An expression of type `Type` (like `Bool` or `Natural -> Text`, but not `Type`)
+/// A Dhall expression representing a simple type.
+///
+/// This captures what is usually simply called a "type", like
+/// `Bool`, `{ x: Integer }` or `Natural -> Text`.
+///
+/// For a more general notion of "type", see [Type].
#[derive(Debug, Clone, Eq)]
pub struct SimpleType<'a>(
pub(crate) SubExpr<X, X>,
@@ -58,13 +63,17 @@ pub struct SimpleType<'a>(
);
derive_other_traits!(SimpleType);
+/// A Dhall expression representing a (possibly higher-kinded) type.
+///
+/// This includes [SimpleType]s but also higher-kinded expressions like
+/// `Type`, `Kind` and `{ x: Type }`.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Type<'a>(pub(crate) TypeInternal<'a>);
#[derive(Debug, Clone, PartialEq, Eq)]
pub(crate) enum TypeInternal<'a> {
Expr(Box<Normalized<'a>>),
- // The type of `Sort`
+ /// The type of `Sort`
SuperType,
}