on master help sign in
Merge pull request #4588 from clayrat/patch-13

Cons is not Nil

commita244099579ffcfa2c6c57c67646dc98e7470bad3 authorNiklas Larsson <metaniklas@gmail.com> dateMon 19 Nov 2018, 14:24 (8 years ago) parent347b63f7695883
1 file changed+6
libs/prelude/Prelude/List.idr+6
libs/prelude/Prelude/List.idr+6
@@ -861,6 +861,12 @@ catMaybes (x::xs) =
861861-- Properties
862862--------------------------------------------------------------------------------
863863
864+Uninhabited ([] = _ :: _) where
865+ uninhabited Refl impossible
866+
867+Uninhabited (_ :: _ = []) where
868+ uninhabited Refl impossible
869+
864870||| (::) is injective
865871consInjective : {x : a} -> {xs : List a} -> {y : b} -> {ys : List b} ->
866872 (x :: xs) = (y :: ys) -> (x = y, xs = ys)