11module Type.Data.Boolean
2- ( BProxy (..)
3- , module Prim.Boolean
2+ ( module Prim.Boolean
43 , class IsBoolean
54 , reflectBoolean
65 , reifyBoolean
@@ -17,21 +16,16 @@ module Type.Data.Boolean
1716import Prim.Boolean (True , False )
1817import Type.Proxy (Proxy (..))
1918
20- -- | Value proxy for `Boolean` types
21- -- | **Deprecated:** Use `Type.Proxy` instead
22- data BProxy :: Boolean -> Type
23- data BProxy bool = BProxy
24-
2519-- | Class for reflecting a type level `Boolean` at the value level
2620class IsBoolean :: Boolean -> Constraint
2721class IsBoolean bool where
28- reflectBoolean :: forall proxy . proxy bool -> Boolean
22+ reflectBoolean :: Proxy bool -> Boolean
2923
3024instance isBooleanTrue :: IsBoolean True where reflectBoolean _ = true
3125instance isBooleanFalse :: IsBoolean False where reflectBoolean _ = false
3226
3327-- | Use a value level `Boolean` as a type-level `Boolean`
34- reifyBoolean :: forall r . Boolean -> (forall proxy o . IsBoolean o => proxy o -> r ) -> r
28+ reifyBoolean :: forall r . Boolean -> (forall o . IsBoolean o => Proxy o -> r ) -> r
3529reifyBoolean true f = f (Proxy :: Proxy True )
3630reifyBoolean false f = f (Proxy :: Proxy False )
3731
@@ -41,7 +35,7 @@ class And lhs rhs out | lhs rhs -> out
4135instance andTrue :: And True rhs rhs
4236instance andFalse :: And False rhs False
4337
44- and :: forall proxy l r o . And l r o => proxy l -> proxy r -> Proxy o
38+ and :: forall l r o . And l r o => Proxy l -> Proxy r -> Proxy o
4539and _ _ = Proxy
4640
4741-- | Or two `Boolean` types together
@@ -50,7 +44,7 @@ class Or lhs rhs output | lhs rhs -> output
5044instance orTrue :: Or True rhs True
5145instance orFalse :: Or False rhs rhs
5246
53- or :: forall proxy l r o . Or l r o => proxy l -> proxy r -> Proxy o
47+ or :: forall l r o . Or l r o => Proxy l -> Proxy r -> Proxy o
5448or _ _ = Proxy
5549
5650-- | Not a `Boolean`
@@ -59,7 +53,7 @@ class Not bool output | bool -> output
5953instance notTrue :: Not True False
6054instance notFalse :: Not False True
6155
62- not :: forall proxy i o . Not i o => proxy i -> Proxy o
56+ not :: forall i o . Not i o => Proxy i -> Proxy o
6357not _ = Proxy
6458
6559-- | If - dispatch based on a boolean
@@ -68,5 +62,5 @@ class If bool onTrue onFalse output | bool onTrue onFalse -> output
6862instance ifTrue :: If True onTrue onFalse onTrue
6963instance ifFalse :: If False onTrue onFalse onFalse
7064
71- if_ :: forall proxy b t e o . If b t e o => proxy b -> Proxy t -> Proxy e -> Proxy o
65+ if_ :: forall b t e o . If b t e o => Proxy b -> Proxy t -> Proxy e -> Proxy o
7266if_ _ _ _ = Proxy
0 commit comments