Fix dhall decode
bug (#859)
... as caught by @singpolyma `Dhall.Binary.unApply` was failing to uncurry functions due to the presence of `Note` constructors. This caused `dhall encode` to produce different results from `dhall hash` since the latter was normalizing the expression (and therefore removing `Note` constructors) whereas the former was not.
This commit is contained in:
parent
c900081a34
commit
4c9dc60b20
|
@ -1 +1 @@
|
|||
Subproject commit 8b9edd288071566eab4d94f643709e1d9ef9e574
|
||||
Subproject commit b1c9e532e66dc1a5d60ddc9a84139212fb1f44a1
|
|
@ -111,13 +111,16 @@ renderStandardVersion V_5_0_0 = "5.0.0"
|
|||
the list of arguments
|
||||
-}
|
||||
unApply :: Expr s a -> (Expr s a, [Expr s a])
|
||||
unApply e = (baseFunction₀, diffArguments₀ [])
|
||||
unApply e₀ = (baseFunction₀, diffArguments₀ [])
|
||||
where
|
||||
~(baseFunction₀, diffArguments₀) = go e
|
||||
~(baseFunction₀, diffArguments₀) = go e₀
|
||||
|
||||
go (App f a) = (baseFunction, diffArguments . (a :))
|
||||
where
|
||||
~(baseFunction, diffArguments) = go f
|
||||
|
||||
go (Note _ e) = go e
|
||||
|
||||
go baseFunction = (baseFunction, id)
|
||||
|
||||
-- | Encode a Dhall expression to a CBOR `Term`
|
||||
|
|
Loading…
Reference in New Issue
Block a user