Skip to content

Commit 228fd8a

Browse files
committed
Replace monomorphic proxies by Type.Proxy.Proxy and polymorphic variables
1 parent d5d3dfd commit 228fd8a

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

src/Type/Data/Boolean.purs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,32 +41,32 @@ class And lhs rhs out | lhs rhs -> out
4141
instance andTrue :: And True rhs rhs
4242
instance andFalse :: And False rhs False
4343

44-
and :: forall l r o. And l r o => BProxy l -> BProxy r -> BProxy o
45-
and _ _ = BProxy
44+
and :: forall proxy l r o. And l r o => proxy l -> proxy r -> Proxy o
45+
and _ _ = Proxy
4646

4747
-- | Or two `Boolean` types together
4848
class Or :: Boolean -> Boolean -> Boolean -> Constraint
4949
class Or lhs rhs output | lhs rhs -> output
5050
instance orTrue :: Or True rhs True
5151
instance orFalse :: Or False rhs rhs
5252

53-
or :: forall l r o. Or l r o => BProxy l -> BProxy r -> BProxy o
54-
or _ _ = BProxy
53+
or :: forall proxy l r o. Or l r o => proxy l -> proxy r -> Proxy o
54+
or _ _ = Proxy
5555

5656
-- | Not a `Boolean`
5757
class Not :: Boolean -> Boolean -> Constraint
5858
class Not bool output | bool -> output
5959
instance notTrue :: Not True False
6060
instance notFalse :: Not False True
6161

62-
not :: forall i o. Not i o => BProxy i -> BProxy o
63-
not _ = BProxy
62+
not :: forall proxy i o. Not i o => proxy i -> Proxy o
63+
not _ = Proxy
6464

6565
-- | If - dispatch based on a boolean
6666
class If :: forall k. Boolean -> k -> k -> k -> Constraint
6767
class If bool onTrue onFalse output | bool onTrue onFalse -> output
6868
instance ifTrue :: If True onTrue onFalse onTrue
6969
instance ifFalse :: If False onTrue onFalse onFalse
7070

71-
if_ :: forall b t e o. If b t e o => BProxy b -> Proxy t -> Proxy e -> Proxy o
71+
if_ :: forall proxy b t e o. If b t e o => proxy b -> Proxy t -> Proxy e -> Proxy o
7272
if_ _ _ _ = Proxy

src/Type/Data/Ordering.purs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module Type.Data.Ordering
1414

1515
import Prim.Ordering (LT, EQ, GT, Ordering) as PO
1616
import Data.Ordering (Ordering(..))
17-
import Type.Data.Boolean (True, False, BProxy(..))
17+
import Type.Data.Boolean (True, False)
1818
import Type.Proxy (Proxy(..))
1919

2020
-- | Value proxy for `Ordering` types
@@ -45,8 +45,8 @@ instance appendOrderingLT :: Append PO.LT rhs PO.LT
4545
instance appendOrderingEQ :: Append PO.EQ rhs rhs
4646
instance appendOrderingGT :: Append PO.GT rhs PO.GT
4747

48-
append :: forall l r o. Append l r o => OProxy l -> OProxy r -> OProxy o
49-
append _ _ = OProxy
48+
append :: forall proxy l r o. Append l r o => proxy l -> proxy r -> Proxy o
49+
append _ _ = Proxy
5050

5151
-- | Invert an `Ordering`
5252
class Invert :: PO.Ordering -> PO.Ordering -> Constraint
@@ -55,8 +55,8 @@ instance invertOrderingLT :: Invert PO.LT PO.GT
5555
instance invertOrderingEQ :: Invert PO.EQ PO.EQ
5656
instance invertOrderingGT :: Invert PO.GT PO.LT
5757

58-
invert :: forall i o. Invert i o => OProxy i -> OProxy o
59-
invert _ = OProxy
58+
invert :: forall proxy i o. Invert i o => proxy i -> Proxy o
59+
invert _ = Proxy
6060

6161
class Equals :: PO.Ordering -> PO.Ordering -> Boolean -> Constraint
6262
class Equals lhs rhs out | lhs rhs -> out
@@ -71,5 +71,5 @@ instance equalsLTGT :: Equals PO.LT PO.GT False
7171
instance equalsGTLT :: Equals PO.GT PO.LT False
7272
instance equalsGTEQ :: Equals PO.GT PO.EQ False
7373

74-
equals :: forall l r o. Equals l r o => OProxy l -> OProxy r -> BProxy o
75-
equals _ _ = BProxy
74+
equals :: forall proxy l r o. Equals l r o => proxy l -> proxy r -> Proxy o
75+
equals _ _ = Proxy

src/Type/Data/Symbol.purs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ module Type.Data.Symbol
1010

1111
import Prim.Symbol (class Append, class Compare, class Cons)
1212
import Data.Symbol (SProxy(..), class IsSymbol, reflectSymbol, reifySymbol)
13-
import Type.Data.Ordering (OProxy(..), EQ)
13+
import Type.Data.Ordering (EQ)
1414
import Type.Data.Ordering (class Equals) as Ordering
15-
import Type.Data.Boolean (BProxy(..))
15+
import Type.Proxy (Proxy(..))
1616

17-
compare :: forall l r o. Compare l r o => SProxy l -> SProxy r -> OProxy o
18-
compare _ _ = OProxy
17+
compare :: forall proxy l r o. Compare l r o => proxy l -> proxy r -> Proxy o
18+
compare _ _ = Proxy
1919

20-
append :: forall l r o. Append l r o => SProxy l -> SProxy r -> SProxy o
21-
append _ _ = SProxy
20+
append :: forall proxy l r o. Append l r o => proxy l -> proxy r -> Proxy o
21+
append _ _ = Proxy
2222

23-
uncons :: forall h t s. Cons h t s => SProxy s -> {head :: SProxy h, tail :: SProxy t}
24-
uncons _ = {head : SProxy, tail : SProxy}
23+
uncons :: forall proxy h t s. Cons h t s => proxy s -> {head :: Proxy h, tail :: Proxy t}
24+
uncons _ = {head : Proxy, tail : Proxy}
2525

2626
class Equals :: Symbol -> Symbol -> Boolean -> Constraint
2727
class Equals lhs rhs out | lhs rhs -> out
@@ -31,5 +31,5 @@ instance equalsSymbol
3131
Ordering.Equals EQ ord out)
3232
=> Equals lhs rhs out
3333

34-
equals :: forall l r o. Equals l r o => SProxy l -> SProxy r -> BProxy o
35-
equals _ _ = BProxy
34+
equals :: forall proxy l r o. Equals l r o => proxy l -> proxy r -> Proxy o
35+
equals _ _ = Proxy

0 commit comments

Comments
 (0)