summaryrefslogtreecommitdiff
path: root/dhall
diff options
context:
space:
mode:
authorNadrieril2019-03-15 23:46:37 +0100
committerNadrieril2019-03-15 23:46:37 +0100
commit1522469dc0b68c63dbbc81faab057c3d48402657 (patch)
tree3357c4ead7d0b45677d4318ee5ea9d3c943bff5f /dhall
parent4f2c27bc1ca8c2147fa8e9292c6cec04ab8d0984 (diff)
rustfmt
Diffstat (limited to '')
-rw-r--r--dhall/src/normalize.rs50
1 files changed, 24 insertions, 26 deletions
diff --git a/dhall/src/normalize.rs b/dhall/src/normalize.rs
index ca261e1..5349c9e 100644
--- a/dhall/src/normalize.rs
+++ b/dhall/src/normalize.rs
@@ -71,17 +71,15 @@ where
(ListBuild, [a0, g]) => {
// fold/build fusion
let g = match g {
- App(f, args) => {
- match (&**f, args.as_slice()) {
- (Builtin(ListFold), [_, x, rest..]) => {
- return normalize_whnf(&App(
- bx(x.clone()),
- rest.to_vec(),
- ))
- }
- (f, args) => app(f.clone(), args.to_vec()),
+ App(f, args) => match (&**f, args.as_slice()) {
+ (Builtin(ListFold), [_, x, rest..]) => {
+ return normalize_whnf(&App(
+ bx(x.clone()),
+ rest.to_vec(),
+ ))
}
- }
+ (f, args) => app(f.clone(), args.to_vec()),
+ },
g => g.clone(),
};
let g = bx(g);
@@ -94,17 +92,15 @@ where
(OptionalBuild, [a0, g]) => {
// fold/build fusion
let g = match g {
- App(f, args) => {
- match (&**f, args.as_slice()) {
- (Builtin(OptionalFold), [_, x, rest..]) => {
- return normalize_whnf(&App(
- bx(x.clone()),
- rest.to_vec(),
- ))
- }
- (f, args) => app(f.clone(), args.to_vec()),
+ App(f, args) => match (&**f, args.as_slice()) {
+ (Builtin(OptionalFold), [_, x, rest..]) => {
+ return normalize_whnf(&App(
+ bx(x.clone()),
+ rest.to_vec(),
+ ))
}
- }
+ (f, args) => app(f.clone(), args.to_vec()),
+ },
g => g.clone(),
};
let g = bx(g);
@@ -146,9 +142,10 @@ where
(Builtin(NaturalFold), [x, rest..]) => {
normalize_whnf(&App(bx(x.clone()), rest.to_vec()))
}
- (f, args) => {
- app(Builtin(NaturalBuild), vec![app(f.clone(), args.to_vec())])
- }
+ (f, args) => app(
+ Builtin(NaturalBuild),
+ vec![app(f.clone(), args.to_vec())],
+ ),
}
}
(NaturalFold, [App(f, args)]) => {
@@ -157,9 +154,10 @@ where
(Builtin(NaturalBuild), [x, rest..]) => {
normalize_whnf(&App(bx(x.clone()), rest.to_vec()))
}
- (f, args) => {
- app(Builtin(NaturalFold), vec![app(f.clone(), args.to_vec())])
- }
+ (f, args) => app(
+ Builtin(NaturalFold),
+ vec![app(f.clone(), args.to_vec())],
+ ),
}
}
(b, args) => App(bx(Builtin(b)), args.to_vec()),