File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
src/Data/Vec/Relation/Unary Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -497,6 +497,11 @@ Other minor additions
497
497
transpose : ∀ {m n} → Vector (Vector A n) m → Vector (Vector A m) n
498
498
```
499
499
500
+ * Added new functions to ` Data.Vec.Relation.Unary.All ` :
501
+ ``` agda
502
+ reduce : (f : ∀ {x} → P x → B) → All P xs → Vec B n
503
+ ```
504
+
500
505
* Added new proofs to ` Data.Vec.Relation.Unary.All.Properties ` :
501
506
``` agda
502
507
All-swap : ∀ {xs ys} → All (λ x → All (x ~_) ys) xs → All (λ y → All (_~ y) xs) ys
Original file line number Diff line number Diff line change @@ -47,6 +47,10 @@ module _ {P : Pred A p} where
47
47
tail : ∀ {n x} {xs : Vec A n} → All P (x ∷ xs) → All P xs
48
48
tail (px ∷ pxs) = pxs
49
49
50
+ reduce : (f : ∀ {x} → P x → B) → ∀ {n} {xs : Vec A n} → All P xs → Vec B n
51
+ reduce f [] = []
52
+ reduce f (px ∷ pxs) = f px ∷ reduce f pxs
53
+
50
54
uncons : ∀ {n x} {xs : Vec A n} → All P (x ∷ xs) → P x × All P xs
51
55
uncons = < head , tail >
52
56
You can’t perform that action at this time.
0 commit comments