Skip to content

Commit 05cc6ba

Browse files
Replace SProxy with Proxy
1 parent 87368e8 commit 05cc6ba

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

src/Data/Symbol.purs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,21 @@ module Data.Symbol
55
, SProxy(..)
66
) where
77

8+
import Type.Proxy (Proxy(..))
9+
810
-- | A value-level proxy for a type-level symbol.
911
data SProxy (sym :: Symbol) = SProxy
1012

1113
-- | A class for known symbols
1214
class IsSymbol (sym :: Symbol) where
13-
reflectSymbol :: SProxy sym -> String
15+
reflectSymbol :: Proxy sym -> String
1416

1517
-- local definition for use in `reifySymbol`
1618
foreign import unsafeCoerce :: forall a b. a -> b
1719

18-
reifySymbol :: forall r. String -> (forall sym. IsSymbol sym => SProxy sym -> r) -> r
19-
reifySymbol s f = coerce f { reflectSymbol: \_ -> s } SProxy where
20+
reifySymbol :: forall r. String -> (forall sym. IsSymbol sym => Proxy sym -> r) -> r
21+
reifySymbol s f = coerce f { reflectSymbol: \_ -> s } Proxy where
2022
coerce
21-
:: (forall sym1. IsSymbol sym1 => SProxy sym1 -> r)
22-
-> { reflectSymbol :: SProxy "" -> String } -> SProxy "" -> r
23+
:: (forall sym1. IsSymbol sym1 => Proxy sym1 -> r)
24+
-> { reflectSymbol :: Proxy "" -> String } -> Proxy "" -> r
2325
coerce = unsafeCoerce
24-

src/Type/Proxy.purs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,21 @@
4848
-- | ```
4949
module Type.Proxy where
5050

51-
import Prelude
51+
import Control.Applicative (class Applicative)
52+
import Control.Apply (class Apply)
53+
import Control.Bind (class Bind, class Discard)
54+
import Control.Monad (class Monad)
55+
56+
import Data.BooleanAlgebra (class BooleanAlgebra)
57+
import Data.Bounded (class Bounded)
58+
import Data.CommutativeRing (class CommutativeRing)
59+
import Data.Eq (class Eq)
60+
import Data.Functor (class Functor)
61+
import Data.HeytingAlgebra (class HeytingAlgebra)
62+
import Data.Ord (class Ord)
63+
import Data.Ring (class Ring)
64+
import Data.Semiring (class Semiring)
65+
import Data.Show (class Show, show)
5266

5367
-- | Proxy type for all `kind`s.
5468
data Proxy :: forall k. k -> Type

0 commit comments

Comments
 (0)