summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNadrieril2019-03-09 10:32:17 +0100
committerNadrieril2019-03-09 10:32:17 +0100
commit19c18f9cd0d192f326fc2946729645cab5e1d416 (patch)
treec90e596a6e225ac3b9bfa5015b41d619fbccb018
parent60d554574d246de43976c8b50a38b514b026a72d (diff)
Rename dhall! to dhall_expr! for clarity
-rw-r--r--dhall/src/normalize.rs10
-rw-r--r--dhall_generator/src/lib.rs2
2 files changed, 6 insertions, 6 deletions
diff --git a/dhall/src/normalize.rs b/dhall/src/normalize.rs
index 038458f..c3bea05 100644
--- a/dhall/src/normalize.rs
+++ b/dhall/src/normalize.rs
@@ -1,6 +1,6 @@
#![allow(non_snake_case)]
use dhall_core::core::*;
-use dhall_generator::dhall;
+use dhall_generator::dhall_expr;
use std::fmt;
/// Reduce an expression to its normal form, performing beta reduction
@@ -92,13 +92,13 @@ where
(App(box Builtin(ListBuild), a0), k) => {
let k = bx(k);
let a1 = bx(shift(1, &V("a".into(), 0), &a0));
- normalize(&dhall!(k (List a0) (λ(a : a0) -> λ(as : List a1) -> [ a ] # as) ([] : List a0)))
+ normalize(&dhall_expr!(k (List a0) (λ(a : a0) -> λ(as : List a1) -> [ a ] # as) ([] : List a0)))
}
(App(box App(box App(box App(box Builtin(ListFold), _), box ListLit(_, xs)), _), cons), nil) => {
let e2: Expr<_, _, _> = xs.into_iter().rev().fold(nil, |y, ys| {
let y = bx(y);
let ys = bx(ys);
- dhall!(cons y ys)
+ dhall_expr!(cons y ys)
});
normalize(&e2)
}
@@ -134,13 +134,13 @@ where
(App(box App(box App(box App(box Builtin(OptionalFold), _), box OptionalLit(_, xs)), _), just), nothing) => {
let e2: Expr<_, _, _> = xs.into_iter().fold(nothing, |y, _| {
let y = bx(y);
- dhall!(just y)
+ dhall_expr!(just y)
});
normalize(&e2)
}
(App(box Builtin(OptionalBuild), a0), g) => {
let g = bx(g);
- normalize(&dhall!((g (Optional a0)) (λ(x: a0) -> [x] : Optional a0) ([] : Optional a0)))
+ normalize(&dhall_expr!((g (Optional a0)) (λ(x: a0) -> [x] : Optional a0) ([] : Optional a0)))
}
(f2, a2) => app(f2, a2),
},
diff --git a/dhall_generator/src/lib.rs b/dhall_generator/src/lib.rs
index 8745c76..d1a8bdf 100644
--- a/dhall_generator/src/lib.rs
+++ b/dhall_generator/src/lib.rs
@@ -6,7 +6,7 @@ use proc_macro2::TokenStream;
use quote::quote;
#[proc_macro]
-pub fn dhall(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
+pub fn dhall_expr(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
let input_str = input.to_string();
let expr: Box<Expr<_, X, Import>> = parser::parse_expr(&input_str).unwrap();
let no_import =