agda / agda-stdlib

The Agda standard library

Home Page:https://wiki.portal.chalmers.se/agda/Libraries/StandardLibrary

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

_≡⟨⟩_ not working anymore on stdlib 2.0

wgbusch opened this issue · comments

Hey, Im using this example from the PLFA book:

_ : 2 + 3 ≡ 5
_ =
  begin
    2 + 3
  ≡⟨⟩    -- is shorthand for
    (suc (suc zero)) + (suc (suc (suc zero)))
  ≡⟨⟩    -- inductive case
    suc ((suc zero) + (suc (suc (suc zero))))
  ≡⟨⟩    -- inductive case
    suc (suc (zero + (suc (suc (suc zero)))))
  ≡⟨⟩    -- base case
    suc (suc (suc (suc (suc zero))))
  ≡⟨⟩    -- is longhand for
    5
  ∎

but it seems that v2.0 completely broke this chain of equations. This is the commit. I don't really know much about Agda but I noticed you moved/removed the operator ≡⟨⟩ from the library. What's the replacement (if any) and how to fix? Thank you.

Thanks for the report!

I just looked into this. The underlying issue isn't that _≡⟨⟩_ has been removed, but that it's now declared as a syntax for a different name, which breaks opening the ≡-Reasoning module with only some names as PLFA instructs. I agree this is unfortunate.

In the meantime, you can replace open Eq.≡-Reasoning using (begin_; _≡⟨⟩_; _∎) with open Eq.≡-Reasoning using (begin_; step-≡-∣; _∎). The convention in stdlib is to not use a using clause on the various Reasoning modules, which is why we hadn't noticed until now.

PLFA insists that you should use specific versions of Agda & its standard library precisely because they are trying to protect users against these kind of breaking changes:

PLFA is tested against specific versions of Agda and the standard library, which are shown in the badges above. Agda and the standard library change rapidly, and these changes often break PLFA, so using older or newer versions usually causes problems. (...) Therefore, it’s important to have the specific versions of Agda and the standard library shown above.

Opened an issue upstream at agda/agda#7137

Suggest we close this now? Given that PLFA provides an answer, and the upstream Agda issue it has given rise to?
Not sure how we should label it though, if at all?

I agree, there is nothing to do on stdlib about this.