diff options
author | Nadrieril | 2019-04-20 23:13:15 +0200 |
---|---|---|
committer | Nadrieril | 2019-04-20 23:13:15 +0200 |
commit | b31690a87e2963d4093210a2c58735a2095e651d (patch) | |
tree | d6bff16ce18dda443aa8b9a2fb31c31f0a502ec4 /dhall/src/binary.rs | |
parent | 9c8ba84fa5d0b392f19e9e9b8569ee2fbe96bd28 (diff) | |
parent | 83bc67d4572fe7961842f915d5559ee489e13dfd (diff) |
Merge branch 'whnf'
Massive normalization rewrite, for greatly improved flexibility
and performance.
Closes #84
Diffstat (limited to '')
-rw-r--r-- | dhall/src/binary.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/dhall/src/binary.rs b/dhall/src/binary.rs index c12aa2a..7ded3a5 100644 --- a/dhall/src/binary.rs +++ b/dhall/src/binary.rs @@ -42,12 +42,12 @@ fn cbor_value_to_dhall(data: &cbor::Value) -> Result<ParsedExpr, DecodeError> { Var(V(l, *n as usize)) } [U64(0), f, args..] => { - let f = cbor_value_to_dhall(&f)?; - let args = args - .iter() - .map(cbor_value_to_dhall) - .collect::<Result<Vec<_>, _>>()?; - App(f, args) + let mut f = cbor_value_to_dhall(&f)?; + for a in args { + let a = cbor_value_to_dhall(&a)?; + f = rc(App(f, a)) + } + return Ok(f); } [U64(1), x, y] => { let x = cbor_value_to_dhall(&x)?; @@ -111,7 +111,7 @@ fn cbor_value_to_dhall(data: &cbor::Value) -> Result<ParsedExpr, DecodeError> { } [U64(5), Null, x] => { let x = cbor_value_to_dhall(&x)?; - NEOptionalLit(x) + SomeLit(x) } [U64(5), t, x] => { let x = cbor_value_to_dhall(&x)?; |