File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
src/Data/Vec/Relation/Unary Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,9 @@ Bug-fixes
30
30
* In ` IO ` , ` ⊤ ` -returning functions (such as ` putStrLn ` ) have been made level polymorphic.
31
31
This may force you to add more type or level annotations to your programs.
32
32
33
+ * Generalised the types of ` Data.Vec.Relation.Unary.AllPairs ` 's ` head ` , ` tail ` , ` uncons `
34
+ so that the vector talked about does not need to be cons-headed.
35
+
33
36
Non-backwards compatible changes
34
37
--------------------------------
35
38
Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ open import Relation.Binary using (Rel)
11
11
module Data.Vec.Relation.Unary.AllPairs
12
12
{a ℓ} {A : Set a} {R : Rel A ℓ} where
13
13
14
- open import Data.Vec.Base using (Vec; []; _∷_)
14
+ open import Data.Nat.Base using (suc)
15
+ open import Data.Vec.Base as Vec using (Vec; []; _∷_)
15
16
open import Data.Vec.Relation.Unary.All as All using (All; []; _∷_)
16
17
open import Data.Product as Prod using (_,_; _×_; uncurry; <_,_>)
17
18
open import Function using (id; _∘_)
@@ -32,13 +33,14 @@ open import Data.Vec.Relation.Unary.AllPairs.Core public
32
33
------------------------------------------------------------------------
33
34
-- Operations
34
35
35
- head : ∀ {x n} {xs : Vec A n } → AllPairs R (x ∷ xs) → All (R x) xs
36
+ head : ∀ {n} {xs : Vec A (suc n) } → AllPairs R xs → All (R (Vec.head xs)) (Vec.tail xs)
36
37
head (px ∷ pxs) = px
37
38
38
- tail : ∀ {x n} {xs : Vec A n } → AllPairs R (x ∷ xs) → AllPairs R xs
39
+ tail : ∀ {n} {xs : Vec A (suc n) } → AllPairs R xs → AllPairs R (Vec.tail xs)
39
40
tail (px ∷ pxs) = pxs
40
41
41
- uncons : ∀ {x n} {xs : Vec A n} → AllPairs R (x ∷ xs) → All (R x) xs × AllPairs R xs
42
+ uncons : ∀ {n} {xs : Vec A (suc n)} → AllPairs R xs →
43
+ All (R (Vec.head xs)) (Vec.tail xs) × AllPairs R (Vec.tail xs)
42
44
uncons = < head , tail >
43
45
44
46
module _ {s} {S : Rel A s} where
You can’t perform that action at this time.
0 commit comments