packages feed

text-show-instances-3.8.6: src/TextShow/Data/Scientific.hs

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

instance TextShow Scientific where
        showbPrec d s
                | coefficient s < 0 = showbParen (d > prefixMinusPrec) (scientificBuilder s)
                | otherwise         = scientificBuilder s
                where prefixMinusPrec :: Int
                      prefixMinusPrec = 6