on master help sign in
Merge pull request #4274 from clayrat/uninhabited-maybe

Add Uninhabited instances for Maybe

commit4431c5a73b9f06d3002c56597cd305ccf8febfba authorAhmad Salim Al-Sibahi <asal@itu.dk> dateTue 2 Jan 2018, 15:12 (9 years ago) parent86e554695cb7b4
1 file changed+6
libs/prelude/Prelude/Maybe.idr+6
libs/prelude/Prelude/Maybe.idr+6
@@ -27,6 +27,12 @@ data Maybe : (a : Type) -> Type where
2727-- Syntactic tests
2828--------------------------------------------------------------------------------
2929
30+Uninhabited (Nothing = Just _) where
31+ uninhabited Refl impossible
32+
33+Uninhabited (Just _ = Nothing) where
34+ uninhabited Refl impossible
35+
3036isNothing : Maybe a -> Bool
3137isNothing Nothing = True
3238isNothing (Just j) = False