Debian Codegraph @

src/Data/List/Membership/Propositional.agda

raw
1 ------------------------------------------------------------------------
2 -- The Agda standard library
3 --
4 -- Data.List.Any.Membership instantiated with propositional equality,
5 -- along with some additional definitions.
6 ------------------------------------------------------------------------
7
8 {-# OPTIONS --cubical-compatible --safe #-}
9
10 module Data.List.Membership.Propositional {a} {A : Set a} where
11
12 open import Data.List.Relation.Unary.Any using (Any)
13 open import Relation.Binary.PropositionalEquality.Core using (_≡_; _≢_; resp)
14 open import Relation.Binary.PropositionalEquality.Properties using (setoid)
15
16 import Data.List.Membership.Setoid as SetoidMembership
17
18 ------------------------------------------------------------------------
19 -- Re-export contents of setoid membership
20
21 open SetoidMembership (setoid A) public hiding (lose)
22
23 ------------------------------------------------------------------------
24 -- Different members
25
26 infix 4 _≢∈_
27
28 _≢∈_ : ∀ {x y : A} {xs} → x ∈ xs → y ∈ xs → Set _
29 _≢∈_ x∈xs y∈xs = ∀ x≡y → resp (_∈ _) x≡y x∈xs ≢ y∈xs
30
31 ------------------------------------------------------------------------
32 -- Other operations
33
34 lose : ∀ {p} {P : A → Set p} {x xs} → x ∈ xs → P x → Any P xs
35 lose = SetoidMembership.lose (setoid A) (resp _)