diff options
author | Nadrieril | 2019-05-09 23:18:55 +0200 |
---|---|---|
committer | Nadrieril | 2019-05-09 23:23:49 +0200 |
commit | 33c1aa4bd1d5b83361eb52d00beb8d8c762225cd (patch) | |
tree | 1219c3305d9b113b10308bb30dc257acc06bc105 /dhall/src/phase/normalize.rs | |
parent | 7ac061b5ddf15ffe3fc4f36b64138b7431429758 (diff) |
Make visibilities more consistent
Diffstat (limited to 'dhall/src/phase/normalize.rs')
-rw-r--r-- | dhall/src/phase/normalize.rs | 17 |
1 files changed, 7 insertions, 10 deletions
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<Thunk>) -> Value { +pub fn apply_builtin(b: Builtin, args: Vec<Thunk>) -> Value { use dhall_syntax::Builtin::*; use Value::*; @@ -246,7 +246,7 @@ pub(crate) fn apply_builtin(b: Builtin, args: Vec<Thunk>) -> 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<Item = InterpolatedTextContents<Thunk>>, ) -> Vec<InterpolatedTextContents<Thunk>> { 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<Ret<'a>> { }) } -pub(crate) fn normalize_one_layer(expr: ExprF<Thunk, X>) -> Value { +pub fn normalize_one_layer(expr: ExprF<Thunk, X>) -> Value { use Ret::{RetExpr, RetThunk, RetThunkRef, RetValue}; use Value::{ BoolLit, DoubleLit, EmptyListLit, EmptyOptionalLit, IntegerLit, Lam, |