{-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE PolyKinds #-} module Test where import GHC.TypeLits import Data.Proxy newtype (name :: k) ::: a = Named a render :: forall l v. (KnownSymbol l, Show v) => (l ::: v) -> String render (Named v) = symbolVal (Proxy :: Proxy l) ++ ": " ++ show v