scratch/main> lib.install @unison/base/releases/7.15.0
main = do
roundtripBug : x ->{IO, Exception} Either [Link.Term] x
roundtripBug x =
Value.load (Value.deserialize (Value.serialize 5 (Value.value x)))
roundtripOk : x ->{IO, Exception} Either [Link.Term] x
roundtripOk x =
x |> Value.value |> Value.serialize 5 |> Value.deserialize |> Value.load
roundtripBug [1, 2, 3] |> Debug.trace "bug"
roundtripOk [1, 2, 3] |> Debug.trace "okay"
Reproduction
The
roundtripBugfunction below returnsRight +1, no matter its input.The
roundtripOkayfunction below behaves okayEnvironment
ucm --version: "1.1.1"