From 4bebcd96b6e76b9b8ae7877af91d2ae571e617a9 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 7 Apr 2019 16:45:30 +0200 Subject: Restrict public API Closes #20 --- dhall/src/normalize.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'dhall/src/normalize.rs') diff --git a/dhall/src/normalize.rs b/dhall/src/normalize.rs index f9633fb..c07d3cb 100644 --- a/dhall/src/normalize.rs +++ b/dhall/src/normalize.rs @@ -8,6 +8,10 @@ impl Typed { pub fn normalize(self) -> Normalized { Normalized(normalize(self.0), self.1) } + /// Pretends this expression is normalized. Use with care. + pub fn skip_normalize(self) -> Normalized { + Normalized(self.0, self.1) + } } fn apply_builtin(b: Builtin, args: &Vec>) -> WhatNext @@ -209,7 +213,7 @@ enum WhatNext<'a, S, A> { DoneAsIs, } -pub fn normalize_ref(expr: &Expr) -> Expr +fn normalize_ref(expr: &Expr) -> Expr where S: fmt::Debug + Clone, A: fmt::Debug + Clone, @@ -313,7 +317,7 @@ where /// However, `normalize` will not fail if the expression is ill-typed and will /// leave ill-typed sub-expressions unevaluated. /// -pub fn normalize(e: SubExpr) -> SubExpr +fn normalize(e: SubExpr) -> SubExpr where S: fmt::Debug + Clone, A: fmt::Debug + Clone, -- cgit v1.2.3