summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNadrieril2019-12-20 19:15:10 +0000
committerNadrieril2019-12-20 19:15:45 +0000
commit5c15f643236c5e14c2e8797b9dc507cffc93c43a (patch)
treec803496c6af9f7847d9bfb158dc6d78556002ebe
parent08593ae84ceae4d5f639d5868c08b99f1622795a (diff)
Fix some comments
-rw-r--r--dhall/src/semantics/phase/mod.rs11
-rw-r--r--dhall/src/syntax/text/printer.rs4
2 files changed, 4 insertions, 11 deletions
diff --git a/dhall/src/semantics/phase/mod.rs b/dhall/src/semantics/phase/mod.rs
index 9359c0b..7c57c3f 100644
--- a/dhall/src/semantics/phase/mod.rs
+++ b/dhall/src/semantics/phase/mod.rs
@@ -77,13 +77,6 @@ impl Resolved {
impl Typed {
/// Reduce an expression to its normal form, performing beta reduction
- ///
- /// `normalize` does not type-check the expression. You may want to type-check
- /// expressions before normalizing them since normalization can convert an
- /// ill-typed expression into a well-typed expression.
- ///
- /// However, `normalize` will not fail if the expression is ill-typed and will
- /// leave ill-typed sub-expressions unevaluated.
pub fn normalize(mut self) -> Normalized {
self.normalize_mut();
Normalized(self)
@@ -109,14 +102,14 @@ impl Typed {
normalize: false,
})
}
- /// Converts a value back to the corresponding AST expression, normalizing in the process.
+ /// Converts a value back to the corresponding AST expression, beta-normalizing in the process.
pub fn normalize_to_expr(&self) -> NormalizedExpr {
self.0.to_expr(ToExprOptions {
alpha: false,
normalize: true,
})
}
- /// Converts a value back to the corresponding AST expression, (akpha,beta)-normalizing in the
+ /// Converts a value back to the corresponding AST expression, (alpha,beta)-normalizing in the
/// process.
pub(crate) fn normalize_to_expr_alpha(&self) -> NormalizedExpr {
self.0.to_expr(ToExprOptions {
diff --git a/dhall/src/syntax/text/printer.rs b/dhall/src/syntax/text/printer.rs
index 7b781ea..78942ed 100644
--- a/dhall/src/syntax/text/printer.rs
+++ b/dhall/src/syntax/text/printer.rs
@@ -16,8 +16,8 @@ enum PrintPhase {
Primitive,
}
-// Wraps an Expr with a phase, so that phase selsction can be done
-// separate from the actual printing
+// Wraps an Expr with a phase, so that phase selection can be done separate from the actual
+// printing.
#[derive(Clone)]
struct PhasedExpr<'a, E>(&'a Expr<E>, PrintPhase);