From e7e79bf32c385fa8c30a45be262ca3d6d8f1f653 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 13 Apr 2019 00:44:58 +0200 Subject: Document all of the API Closes #64 --- dhall/src/expr.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'dhall/src/expr.rs') 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, @@ -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>), - // The type of `Sort` + /// The type of `Sort` SuperType, } -- cgit v1.2.3