Idris2/tests/idris2/record007/Bond.idr
Matúš Tejiščák f4a790ded4
Identify prefix and postfix record projections (#1183)
`.proj` and `proj` are identically defined but separate functions.
This patch fixes it by defining `.proj` only once, and adding `proj = (.proj)`
for every projection.
2021-03-15 13:40:13 +00:00

14 lines
380 B
Idris

%unbound_implicits off
record JamesBondTheme where
isVinyl : Bool
-- The James Bond Equality states that for every record field `f`,
-- the prefix form `f` must be definitionally equal to `.f`.
jbeq : isVinyl = (.isVinyl)
jbeq = Refl
-- Then its applications are seamlessly interchangeable, too.
jbeqApp : (rec : JamesBondTheme) -> isVinyl rec = rec.isVinyl
jbeqApp _ = Refl