#if !(MIN_VERSION_bytestring(0,10,0))
#endif
module Text.Show.Text.Data.ByteString (
showbByteStringStrict
, showbByteStringLazy
, showbByteStringLazyPrec
, showbShortByteString
) where
import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy as BL
import Data.ByteString.Short (ShortByteString)
import Data.Text.Lazy.Builder (Builder)
import Prelude hiding (Show(show))
import Text.Show.Text.Classes (Show(showb, showbPrec), FromStringShow(..))
#if !(MIN_VERSION_bytestring(0,10,0))
import Text.Show.Text.TH.Internal (deriveShowPragmas, defaultInlineShowbPrec)
#endif
#include "inline.h"
showbByteStringStrict :: BS.ByteString -> Builder
showbByteStringStrict = showb . FromStringShow
showbByteStringLazy :: BL.ByteString -> Builder
showbByteStringLazy = showbByteStringLazyPrec 0
showbByteStringLazyPrec :: Int -> BL.ByteString -> Builder
#if MIN_VERSION_bytestring(0,10,0)
showbByteStringLazyPrec _ = showb . FromStringShow
#else
showbByteStringLazyPrec = showbPrec
#endif
showbShortByteString :: ShortByteString -> Builder
showbShortByteString = showb . FromStringShow
instance Show BS.ByteString where
showb = showbByteStringStrict
INLINE_INST_FUN(showb)
#if MIN_VERSION_bytestring(0,10,0)
instance Show BL.ByteString where
showbPrec = showbByteStringLazyPrec
INLINE_INST_FUN(showbPrec)
#else
$(deriveShowPragmas defaultInlineShowbPrec ''BL.ByteString)
#endif
instance Show ShortByteString where
showb = showbShortByteString
INLINE_INST_FUN(showb)