1
1
module Type.Data.Boolean
2
- ( BProxy (..)
3
- , module Prim.Boolean
2
+ ( module Prim.Boolean
4
3
, class IsBoolean
5
4
, reflectBoolean
6
5
, reifyBoolean
@@ -17,21 +16,16 @@ module Type.Data.Boolean
17
16
import Prim.Boolean (True , False )
18
17
import Type.Proxy (Proxy (..))
19
18
20
- -- | Value proxy for `Boolean` types
21
- -- | **Deprecated:** Use `Type.Proxy` instead
22
- data BProxy :: Boolean -> Type
23
- data BProxy bool = BProxy
24
-
25
19
-- | Class for reflecting a type level `Boolean` at the value level
26
20
class IsBoolean :: Boolean -> Constraint
27
21
class IsBoolean bool where
28
- reflectBoolean :: forall proxy . proxy bool -> Boolean
22
+ reflectBoolean :: Proxy bool -> Boolean
29
23
30
24
instance isBooleanTrue :: IsBoolean True where reflectBoolean _ = true
31
25
instance isBooleanFalse :: IsBoolean False where reflectBoolean _ = false
32
26
33
27
-- | 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
35
29
reifyBoolean true f = f (Proxy :: Proxy True )
36
30
reifyBoolean false f = f (Proxy :: Proxy False )
37
31
@@ -41,7 +35,7 @@ class And lhs rhs out | lhs rhs -> out
41
35
instance andTrue :: And True rhs rhs
42
36
instance andFalse :: And False rhs False
43
37
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
45
39
and _ _ = Proxy
46
40
47
41
-- | Or two `Boolean` types together
@@ -50,7 +44,7 @@ class Or lhs rhs output | lhs rhs -> output
50
44
instance orTrue :: Or True rhs True
51
45
instance orFalse :: Or False rhs rhs
52
46
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
54
48
or _ _ = Proxy
55
49
56
50
-- | Not a `Boolean`
@@ -59,7 +53,7 @@ class Not bool output | bool -> output
59
53
instance notTrue :: Not True False
60
54
instance notFalse :: Not False True
61
55
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
63
57
not _ = Proxy
64
58
65
59
-- | If - dispatch based on a boolean
@@ -68,5 +62,5 @@ class If bool onTrue onFalse output | bool onTrue onFalse -> output
68
62
instance ifTrue :: If True onTrue onFalse onTrue
69
63
instance ifFalse :: If False onTrue onFalse onFalse
70
64
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
72
66
if_ _ _ _ = Proxy
0 commit comments