-
Notifications
You must be signed in to change notification settings - Fork 251
Open
Labels
Description
The types of these two operations (introduced in #1640 ) are too strict in their m ≤ n
argument, when this could be made irrelevant:
------------------------------------------------------------------------
-- Operations involving ≤
-- Take the first 'm' elements of a vector.
truncate : .(m ≤ n) → Vec A n → Vec A m
truncate {m = zero} _ _ = []
truncate {m = suc _} le (x ∷ xs) = x ∷ truncate (s≤s⁻¹ le) xs
-- Pad out a vector with extra elements.
padRight : .(m ≤ n) → A → Vec A m → Vec A n
padRight {n = n} _ a [] = replicate n a
padRight {n = suc _} le a (x ∷ xs) = x ∷ padRight (s≤s⁻¹ le) a xs
A non-breaking
change, because every existing call site will have the same form as now, even though the type is strictly more constrained?
So: should we make it for v2.x, in view of #2769 or wait for v3.0?
gallais and JacquesCarette