{-# OPTIONS -Wno-orphans #-}
module TextShow.Data.Scientific () where
import Data.Scientific
import Data.Text.Lazy.Builder.Scientific ( scientificBuilder )
import TextShow

instance TextShow Scientific where
        showbPrec :: Int -> Scientific -> Builder
showbPrec Int
d Scientific
s
                | Scientific -> Integer
coefficient Scientific
s forall a. Ord a => a -> a -> Bool
< Integer
0 = Bool -> Builder -> Builder
showbParen (Int
d forall a. Ord a => a -> a -> Bool
> Int
prefixMinusPrec) (Scientific -> Builder
scientificBuilder Scientific
s)
                | Bool
otherwise         = Scientific -> Builder
scientificBuilder Scientific
s
                where prefixMinusPrec :: Int
                      prefixMinusPrec :: Int
prefixMinusPrec = Int
6