Skip to content

Commit f0ef8a6

Browse files
Add All.lookup over setoid membership (#1337)
1 parent 4099f61 commit f0ef8a6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Data/List/Relation/Unary/All.agda

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,13 @@ module _ {P : Pred A p} where
207207
lookup : {xs} All P xs ( {x} x ∈ₚ xs P x)
208208
lookup pxs = lookupWith (λ { px refl px }) pxs
209209

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+
210217
------------------------------------------------------------------------
211218
-- Properties of predicates preserved by All
212219

0 commit comments

Comments
 (0)