Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/Data/Symbol.purs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,19 @@ module Data.Symbol
import Type.Proxy (Proxy(..))

-- | A value-level proxy for a type-level symbol.
-- | **Deprecated as of v0.14.0 PureScript release**: use `Type.Proxy` instead.
data SProxy (sym :: Symbol) = SProxy

-- | A class for known symbols
class IsSymbol (sym :: Symbol) where
reflectSymbol :: Proxy sym -> String
-- Note: Before v0.14.0, we did not have polykinds. Thus, we needed
-- kind-specific proxy types to pass a Symbol around.
-- Once v0.14.0 was released, we could use the kind-generic `Proxy` type
-- insteand. However, to reduce the code breakage, we're using
-- `forall proxy. proxy sym` here so that `SProxy` code will still compile.
-- When PureScript makes a new breaking release after the v0.14.0 release,
-- this type signature will be updated to `Proxy sym -> String`.
reflectSymbol :: forall proxy. proxy sym -> String

-- local definition for use in `reifySymbol`
foreign import unsafeCoerce :: forall a b. a -> b
Expand Down