#if MIN_VERSION_base(4,8,1)
#endif
module TextShow.GHC.Stack (
#if !(MIN_VERSION_base(4,8,1))
) where
#else
showbCallStackPrec
, showbSrcLocPrec
) where
import Data.Text.Lazy.Builder (Builder)
import GHC.Stack (CallStack)
# if MIN_VERSION_base(4,9,0)
import GHC.Stack (SrcLoc, getCallStack)
# else
import GHC.SrcLoc (SrcLoc)
# endif
import TextShow.Classes (TextShow(..))
import TextShow.Data.Char ()
import TextShow.Data.Integral ()
import TextShow.Data.List ()
import TextShow.Data.Tuple ()
import TextShow.TH.Internal (deriveTextShow)
showbCallStackPrec :: Int -> CallStack -> Builder
# if MIN_VERSION_base(4,9,0)
showbCallStackPrec _ = showb . getCallStack
# else
showbCallStackPrec = showbPrec
# endif
showbSrcLocPrec :: Int -> SrcLoc -> Builder
showbSrcLocPrec = showbPrec
# if MIN_VERSION_base(4,9,0)
instance TextShow CallStack where
showb = showbCallStackPrec 0
# else
$(deriveTextShow ''CallStack)
# endif
$(deriveTextShow ''SrcLoc)
#endif