From 33c1aa4bd1d5b83361eb52d00beb8d8c762225cd Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Thu, 9 May 2019 23:18:55 +0200 Subject: Make visibilities more consistent --- dhall/src/phase/normalize.rs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'dhall/src/phase/normalize.rs') diff --git a/dhall/src/phase/normalize.rs b/dhall/src/phase/normalize.rs index 64de2a7..2253ae0 100644 --- a/dhall/src/phase/normalize.rs +++ b/dhall/src/phase/normalize.rs @@ -11,10 +11,10 @@ use crate::core::value::Value; use crate::core::var::Subst; use crate::phase::{NormalizedSubExpr, ResolvedSubExpr, Typed}; -pub(crate) type InputSubExpr = ResolvedSubExpr; -pub(crate) type OutputSubExpr = NormalizedSubExpr; +pub type InputSubExpr = ResolvedSubExpr; +pub type OutputSubExpr = NormalizedSubExpr; -pub(crate) fn apply_builtin(b: Builtin, args: Vec) -> Value { +pub fn apply_builtin(b: Builtin, args: Vec) -> Value { use dhall_syntax::Builtin::*; use Value::*; @@ -246,7 +246,7 @@ pub(crate) fn apply_builtin(b: Builtin, args: Vec) -> Value { } } -pub(crate) fn apply_any(f: Thunk, a: Thunk) -> Value { +pub fn apply_any(f: Thunk, a: Thunk) -> Value { let fallback = |f: Thunk, a: Thunk| Value::PartialExpr(ExprF::App(f, a)); let f_borrow = f.as_value(); @@ -302,7 +302,7 @@ pub(crate) fn apply_any(f: Thunk, a: Thunk) -> Value { } } -pub(crate) fn squash_textlit( +pub fn squash_textlit( elts: impl Iterator>, ) -> Vec> { use std::mem::replace; @@ -345,10 +345,7 @@ pub(crate) fn squash_textlit( } /// Reduces the imput expression to a Value. Evaluates as little as possible. -pub(crate) fn normalize_whnf( - ctx: NormalizationContext, - expr: InputSubExpr, -) -> Value { +pub fn normalize_whnf(ctx: NormalizationContext, expr: InputSubExpr) -> Value { match expr.as_ref() { ExprF::Embed(e) => return e.to_value(), ExprF::Var(v) => return ctx.lookup(v), @@ -520,7 +517,7 @@ fn apply_binop<'a>(o: BinOp, x: &'a Thunk, y: &'a Thunk) -> Option> { }) } -pub(crate) fn normalize_one_layer(expr: ExprF) -> Value { +pub fn normalize_one_layer(expr: ExprF) -> Value { use Ret::{RetExpr, RetThunk, RetThunkRef, RetValue}; use Value::{ BoolLit, DoubleLit, EmptyListLit, EmptyOptionalLit, IntegerLit, Lam, -- cgit v1.2.3