We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
All.lookup
1 parent 4099f61 commit f0ef8a6Copy full SHA for f0ef8a6
src/Data/List/Relation/Unary/All.agda
@@ -207,6 +207,13 @@ module _ {P : Pred A p} where
207
lookup : ∀ {xs} → All P xs → (∀ {x} → x ∈ₚ xs → P x)
208
lookup pxs = lookupWith (λ { px refl → px }) pxs
209
210
+module _(S : Setoid a ℓ) {P : Pred (Setoid.Carrier S) p} where
211
+ open Setoid S renaming (sym to sym₁)
212
+ open SetoidMembership S
213
+
214
+ lookupₛ : ∀ {xs} → P Respects _≈_ → All P xs → (∀ {x} → x ∈ xs → P x)
215
+ lookupₛ resp pxs = lookupWith (λ py x=y → resp (sym₁ x=y) py) pxs
216
217
------------------------------------------------------------------------
218
-- Properties of predicates preserved by All
219
0 commit comments