Theoremroundtrip_just_nothing
Just Nothing at Maybe (Maybe Int) encodes as null, which decodes as Nothing.
Statement
theorem roundtrip_just_nothing :
enc (.maybe (.maybe .int)) (.con conJust [.con conNothing []]) = some .null ∧
dec (.maybe (.maybe .int)) .null = some (.con conNothing [])Proof
⟨by decide +kernel, rfl⟩Proved by decide +kernel: Lean's kernel itself runs the decision procedure, here the evaluator, and checks that the answer is true, so nothing outside the kernel is trusted.
In StandardElmMech/Eff/RoundTrip.lean: The round trip of encoding and decoding (roundtrip), except where A88 says otherwise (NoExc), under the named hypothesis FloatRoundTrip; the exceptions shown to be needed.
A Standard Definition of Elm? (Draft version 0.4) © Rupert Smith. The text is licensed under CC BY 4.0: share and adapt it freely, with credit and a link to the licence.