Add a helpful utility function
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
parent
52e7a7a208
commit
3a537f54ba
|
@ -32,6 +32,10 @@ All¬-¬Any : ∀ {p c} {C : Set c} {P : C → Set p} {l : List C} → All (λ x
|
||||||
All¬-¬Any {l = x ∷ xs} (¬Px ∷ _) (here Px) = ¬Px Px
|
All¬-¬Any {l = x ∷ xs} (¬Px ∷ _) (here Px) = ¬Px Px
|
||||||
All¬-¬Any {l = x ∷ xs} (_ ∷ ¬Pxs) (there Pxs) = All¬-¬Any ¬Pxs Pxs
|
All¬-¬Any {l = x ∷ xs} (_ ∷ ¬Pxs) (there Pxs) = All¬-¬Any ¬Pxs Pxs
|
||||||
|
|
||||||
|
All-single : ∀ {p c} {C : Set c} {P : C → Set p} {c : C} {l : List C} → All P l → c ∈ l → P c
|
||||||
|
All-single {c = c} {l = x ∷ xs} (p ∷ ps) (here refl) = p
|
||||||
|
All-single {c = c} {l = x ∷ xs} (p ∷ ps) (there c∈xs) = All-single ps c∈xs
|
||||||
|
|
||||||
All-x∈xs : ∀ {a} {A : Set a} (xs : List A) → All (λ x → x ∈ xs) xs
|
All-x∈xs : ∀ {a} {A : Set a} (xs : List A) → All (λ x → x ∈ xs) xs
|
||||||
All-x∈xs [] = []
|
All-x∈xs [] = []
|
||||||
All-x∈xs (x ∷ xs') = here refl ∷ map there (All-x∈xs xs')
|
All-x∈xs (x ∷ xs') = here refl ∷ map there (All-x∈xs xs')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user