Hi I think I don't understand well how to use Vec.filter
from Data/Vec.agda
.
I know how to "filter in" (keep) elements in the vector
filterProof : v.filter (λ e → e ≟ 2) (2 v.∷ v.[]) ≡ (2 vb.∷ vb.[])
filterProof = refl
however I'm not sure how to "filter out" elements.
filterProof : v.filter (λ e → e ? 2) (2 v.∷ v.[]) ≡ vb.[]
filterProof = refl
I'm not sure what goes where ?
is.
I know the type needs to be Relation.Nullary.Dec
but not sure how to express e ≠ 2
using what's available in Relation.Nullary.Dec
.
Also I would like to know why Vec.filter
doesn't filter using a Bool
instead of Relation.Nullary.Dec
like List.filter
does.
Thanks!