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
55 , SProxy (..)
66 ) where
77
8+ import Type.Proxy (Proxy (..))
9+
810-- | A value-level proxy for a type-level symbol.
911data SProxy (sym :: Symbol ) = SProxy
1012
1113-- | A class for known symbols
1214class IsSymbol (sym :: Symbol ) where
13- reflectSymbol :: SProxy sym -> String
15+ reflectSymbol :: Proxy sym -> String
1416
1517-- local definition for use in `reifySymbol`
1618foreign 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-
Original file line number Diff line number Diff line change 4848-- | ```
4949module 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.
5468data Proxy :: forall k . k -> Type
You can’t perform that action at this time.
0 commit comments