on master help sign in
Merge pull request #1413 from david-christiansen/master

Add Uninhabited instance for Any p []

commite729d1a9ab559a163d1d9f36033a7be3322fd709 authorDavid Christiansen <david@davidchristiansen.dk> dateWed 23 Jul 2014, 14:45 (12 years ago) parent7fa538a7ca1a6f
1 file changed+4−1
libs/base/Data/Vect/Quantifiers.idr+4−1
libs/base/Data/Vect/Quantifiers.idr+4−1
@@ -5,9 +5,12 @@ data Any : (P : a -> Type) -> Vect n a -> Type where
55 There : {P : a -> Type} -> {xs : Vect n a} -> Any P xs -> Any P (x :: xs)
66
77anyNilAbsurd : {P : a -> Type} -> Any P Nil -> _|_
8−anyNilAbsurd (Here _) impossible
8+anyNilAbsurd (Here _) impossible
99anyNilAbsurd (There _) impossible
1010
11+instance Uninhabited (Any p Nil) where
12+ uninhabited = anyNilAbsurd
13+
1114anyElim : {xs : Vect n a} -> {P : a -> Type} -> (Any P xs -> b) -> (P x -> b) -> Any P (x :: xs) -> b
1215anyElim _ f (Here p) = f p
1316anyElim f _ (There p) = f p