on master help sign in
Merge pull request #1169 from david-christiansen/so-false
a92dfa1David Christiansen
libs/prelude/Prelude/Bool.idr+5
@@ -2,6 +2,8 @@ module Prelude.Bool
2
2
3import Builtins
3import Builtins
4
4
5+import Prelude.Uninhabited
6+
5||| Boolean Data Type
7||| Boolean Data Type
6data Bool = False | True
8data Bool = False | True
7
9
@@ -16,6 +18,9 @@ boolElim False t e = e
16||| Defines a predicate on Bool which guarantees that the value is true.
18||| Defines a predicate on Bool which guarantees that the value is true.
17data so : Bool -> Type where oh : so True
19data so : Bool -> Type where oh : so True
18
20
21+instance Uninhabited (so False) where
22+ uninhabited oh impossible
23+
19-- Syntactic sugar for boolean elimination.
24-- Syntactic sugar for boolean elimination.
20syntax if [test] then [t] else [e] = boolElim test (Delay t) (Delay e)
25syntax if [test] then [t] else [e] = boolElim test (Delay t) (Delay e)
21
26