on master help sign in
Rename isLength

Aiming for a convention in the Prelude where names beginning 'is' return a Bool.

commitb49893edc5641e28ebb45ed6c9c694de1eb470af authorEdwin Brady <ecb10@st-andrews.ac.uk> dateMon 2 Nov 2015, 14:38 (11 years ago) parent5e94bc9
1 file changed+5−5
libs/base/Data/Vect.idr+5−5
libs/base/Data/Vect.idr+5−5
@@ -614,11 +614,11 @@ mapElem (There e) = There (mapElem e)
614614||| @xs the vector with the desired length
615615-- Needs to be Maybe rather than Dec, because if 'n' is unequal to m, we
616616-- only know we don't know how to make a Vect n a, not that one can't exist.
617−isLength : {m : Nat} -> -- expected at run-time
618− (len : Nat) -> (xs : Vect m a) -> Maybe (Vect len a)
619−isLength {m} len xs with (decEq m len)
620− isLength {m = m} m xs | (Yes Refl) = Just xs
621− isLength {m = m} len xs | (No contra) = Nothing
617+exactLength : {m : Nat} -> -- expected at run-time
618+ (len : Nat) -> (xs : Vect m a) -> Maybe (Vect len a)
619+exactLength {m} len xs with (decEq m len)
620+ exactLength {m = m} m xs | (Yes Refl) = Just xs
621+ exactLength {m = m} len xs | (No contra) = Nothing
622622
623623||| If the given Vect is at least the required length, return a Vect with
624624||| at least that length in its type, otherwise return Nothing