#if MIN_VERSION_base(4,8,0)
#endif
module Text.Show.Text.Numeric.Natural (showbNaturalPrec) where
import Data.Text.Lazy.Builder (Builder)
#if MIN_VERSION_base(4,8,0)
import GHC.Integer.GMP.Internals (Integer(..))
import GHC.Natural (Natural(..))
import GHC.Types (Word(..))
import Text.Show.Text.Data.Integral (showbWord)
#else
import Numeric.Natural (Natural)
#endif
import Prelude hiding (Show)
import Text.Show.Text.Classes (Show(showbPrec))
import Text.Show.Text.Data.Integral (showbIntegerPrec)
#include "inline.h"
showbNaturalPrec :: Int -> Natural -> Builder
#if MIN_VERSION_base(4,8,0)
showbNaturalPrec _ (NatS# w#) = showbWord $ W# w#
showbNaturalPrec p (NatJ# bn) = showbIntegerPrec p $ Jp# bn
#else
showbNaturalPrec p = showbIntegerPrec p . toInteger
#endif
instance Show Natural where
showbPrec = showbNaturalPrec
INLINE_INST_FUN(showbPrec)