From f5f9727050a2683b6ee63c4ad619c67d983426aa Mon Sep 17 00:00:00 2001 From: Guilherme Silva Date: Thu, 14 Dec 2023 05:06:36 +0100 Subject: [PATCH] Added pointwise and catmaybe in Lists (#2222) * added pointwise and catmaybe * added pointwise to any * added cat maybe all * changed pointwise definition * changed files name * fixed changelogs and properties * changed Any solution * changed pointwise to catMaybe --------- Co-authored-by: Guilherme Co-authored-by: MatthewDaggitt --- CHANGELOG.md | 12 ++++++++++++ src/Data/List/Relation/Unary/All/Properties.agda | 14 +++++++++++++- .../List/Relation/Unary/AllPairs/Properties.agda | 16 ++++++++++++++-- src/Data/Maybe/Relation/Binary/Pointwise.agda | 5 +++++ 4 files changed, 44 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e10ca58108..2701cdde9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,7 +27,19 @@ New modules Additions to existing modules ----------------------------- +* In `Data.Maybe.Relation.Binary.Pointwise`: + ```agda + pointwise⊆any : Pointwise R (just x) ⊆ Any (R x) + ``` + +* In `Data.List.Relation.Unary.All.Properties`: + ```agda + All-catMaybes⁺ : All (Maybe.All P) xs → All P (catMaybes xs) + Any-catMaybes⁺ : All (Maybe.Any P) xs → All P (catMaybes xs) + ``` + * In `Data.List.Relation.Unary.AllPairs.Properties`: ``` + catMaybes⁺ : AllPairs (Pointwise R) xs → AllPairs R (catMaybes xs) tabulate⁺-< : (i < j → R (f i) (f j)) → AllPairs R (tabulate f) ``` diff --git a/src/Data/List/Relation/Unary/All/Properties.agda b/src/Data/List/Relation/Unary/All/Properties.agda index 1b55bcd2b8..d2a57b7143 100644 --- a/src/Data/List/Relation/Unary/All/Properties.agda +++ b/src/Data/List/Relation/Unary/All/Properties.agda @@ -28,7 +28,8 @@ import Data.List.Relation.Binary.Equality.Setoid as ListEq using (_≋_; []; _ open import Data.List.Relation.Binary.Pointwise.Base using (Pointwise; []; _∷_) open import Data.List.Relation.Binary.Subset.Propositional using (_⊆_) open import Data.Maybe.Base as Maybe using (Maybe; just; nothing) -open import Data.Maybe.Relation.Unary.All as Maybe using (just; nothing) +open import Data.Maybe.Relation.Unary.All as Maybe using (just; nothing; fromAny) +open import Data.Maybe.Relation.Unary.Any as Maybe using (just) open import Data.Nat.Base using (zero; suc; s≤s; _<_; z