module TextShow.Data.Typeable.Utils (showbArgs, showbTuple) where
import Data.Text.Lazy.Builder (Builder, singleton)
import Prelude ()
import Prelude.Compat
import TextShow.Classes (TextShow(..))
showbArgs :: TextShow a => Builder -> [a] -> Builder
showbArgs _ [] = mempty
showbArgs _ [a] = showbPrec 10 a
showbArgs sep (a:as) = showbPrec 10 a <> sep <> showbArgs sep as
showbTuple :: TextShow a => [a] -> Builder
showbTuple args = singleton '(' <> showbArgs (singleton ',') args <> singleton ')'
{-# INLINE showbTuple #-}