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 :: forall a. TextShow a => Builder -> [a] -> Builder
showbArgs Builder
_ [] = forall a. Monoid a => a
mempty
showbArgs Builder
_ [a
a] = forall a. TextShow a => Int -> a -> Builder
showbPrec Int
10 a
a
showbArgs Builder
sep (a
a:[a]
as) = forall a. TextShow a => Int -> a -> Builder
showbPrec Int
10 a
a forall a. Semigroup a => a -> a -> a
<> Builder
sep forall a. Semigroup a => a -> a -> a
<> forall a. TextShow a => Builder -> [a] -> Builder
showbArgs Builder
sep [a]
as
showbTuple :: TextShow a => [a] -> Builder
showbTuple :: forall a. TextShow a => [a] -> Builder
showbTuple [a]
args = Char -> Builder
singleton Char
'(' forall a. Semigroup a => a -> a -> a
<> forall a. TextShow a => Builder -> [a] -> Builder
showbArgs (Char -> Builder
singleton Char
',') [a]
args forall a. Semigroup a => a -> a -> a
<> Char -> Builder
singleton Char
')'
{-# INLINE showbTuple #-}