{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE Safe #-}
{-# OPTIONS_HADDOCK show-extensions #-}
module Clash.Promoted.Symbol
(SSymbol (..), ssymbolProxy, ssymbolToString)
where
import GHC.TypeLits (KnownSymbol, Symbol, symbolVal)
data SSymbol (s :: Symbol) where
SSymbol :: KnownSymbol s => SSymbol s
instance Show (SSymbol s) where
show s@SSymbol = symbolVal s
{-# INLINE ssymbolProxy #-}
ssymbolProxy :: KnownSymbol s => proxy s -> SSymbol s
ssymbolProxy _ = SSymbol
{-# INLINE ssymbolToString #-}
ssymbolToString :: SSymbol s -> String
ssymbolToString s@SSymbol = symbolVal s