File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,12 @@ Non-backwards compatible changes
15
15
Minor improvements
16
16
------------------
17
17
18
+ * The types of ` Data.Vec.Base.{truncate|padRight} ` have been weakened so
19
+ that the argument of type ` m ≤ n ` is marked as irrelevant. This should be
20
+ backwards compatible, but does change the equational behaviour of these
21
+ functions to be more eager, because no longer blocking on pattern matching
22
+ on that argument.
23
+
18
24
Deprecated modules
19
25
------------------
20
26
Original file line number Diff line number Diff line change @@ -289,14 +289,14 @@ uncons (x ∷ xs) = x , xs
289
289
-- Operations involving ≤
290
290
291
291
-- Take the first 'm' elements of a vector.
292
- truncate : ∀ {m n} → m ≤ n → Vec A n → Vec A m
293
- truncate {m = zero} _ _ = []
294
- truncate (s≤s le) (x ∷ xs) = x ∷ (truncate le xs)
292
+ truncate : .(m ≤ n) → Vec A n → Vec A m
293
+ truncate {m = zero} _ _ = []
294
+ truncate {m = suc _} le (x ∷ xs) = x ∷ (truncate (s≤s⁻¹ le) xs)
295
295
296
296
-- Pad out a vector with extra elements.
297
- padRight : ∀ {m n} → m ≤ n → A → Vec A m → Vec A n
298
- padRight z≤n a xs = replicate _ a
299
- padRight (s≤s le) a (x ∷ xs) = x ∷ padRight le a xs
297
+ padRight : .(m ≤ n) → A → Vec A m → Vec A n
298
+ padRight {n = _} _ a [] = replicate _ a
299
+ padRight {n = suc _} le a (x ∷ xs) = x ∷ padRight (s≤s⁻¹ le) a xs
300
300
301
301
------------------------------------------------------------------------
302
302
-- Operations for converting between lists
You can’t perform that action at this time.
0 commit comments