File tree Expand file tree Collapse file tree 2 files changed +22
-7
lines changed Expand file tree Collapse file tree 2 files changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -5,20 +5,21 @@ module Data.Symbol
5
5
, SProxy (..)
6
6
) where
7
7
8
+ import Type.Proxy (Proxy (..))
9
+
8
10
-- | A value-level proxy for a type-level symbol.
9
11
data SProxy (sym :: Symbol ) = SProxy
10
12
11
13
-- | A class for known symbols
12
14
class IsSymbol (sym :: Symbol ) where
13
- reflectSymbol :: SProxy sym -> String
15
+ reflectSymbol :: Proxy sym -> String
14
16
15
17
-- local definition for use in `reifySymbol`
16
18
foreign import unsafeCoerce :: forall a b . a -> b
17
19
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
20
22
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
23
25
coerce = unsafeCoerce
24
-
Original file line number Diff line number Diff line change 48
48
-- | ```
49
49
module Type.Proxy where
50
50
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 )
52
66
53
67
-- | Proxy type for all `kind`s.
54
68
data Proxy :: forall k . k -> Type
You can’t perform that action at this time.
0 commit comments