-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attempt at deprecating inspect idiom #1630
Conversation
I think it's an upstream problem: it looks like the code doing abstraction is not handling with-in properly. open import Agda.Builtin.Bool
open import Agda.Builtin.Equality
open import Agda.Builtin.List
open import Agda.Builtin.Sigma
filter : {A : Set} (p : A → Bool) →
(xs : List A) → List (Σ A λ a → p a ≡ true)
filter p [] = []
filter p (x ∷ xs) with p x in eq
... | false = filter p xs
... | true = (x , eq) ∷ filter p xs
map : {A B : Set} → (A → B) → List A → List B
map f [] = []
map f (x ∷ xs) = f x ∷ map f xs
filter-filter : {A : Set} (p : A → Bool) → (xs : List A) →
filter p (map fst (filter p xs)) ≡ filter p xs
filter-filter p [] = refl
filter-filter p (x ∷ xs) with p x
... | b = {!!} |
Yet another bug found while trying to get this working: agda/agda#5818 In conclusion this definitely shouldn't be merged until these upstream issues are fixed... |
Moving to |
Attempts to fix #1580.
There's one small fly in the ointment and that's the following use in
Data.List.NonEmpty
agda-stdlib/src/Data/List/NonEmpty.agda
Line 68 in 5ac8015
where I get the dreaded
!= w
error below if I try and usewith ... in
instead. Had a hack at it for the last 15 minutes but no matter what I try, I can't seem to get rid of it. @gallais if you have a spare 10 minutes at some point any chance you could take a look?If we can't fix it, then I'll have a go at rewriting the functions. They're currently not very compliant with the standard library style anyway as they mix both computations and proofs.