{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module TextShow.Trace.Hpc () where
import Prelude ()
import Prelude.Compat
import TextShow (TextShow(..), FromStringShow(..), singleton)
import TextShow.Data.Time ()
import TextShow.TH (deriveTextShow)
import Trace.Hpc.Mix (Mix, BoxLabel, CondBox)
import Trace.Hpc.Tix (Tix, TixModule)
import Trace.Hpc.Util (HpcPos, Hash, fromHpcPos)
instance TextShow HpcPos where
showb hp = case fromHpcPos hp of
(l1, c1, l2, c2) -> showb l1
<> (singleton ':' <> showb c1)
<> (singleton '-' <> showb l2)
<> (singleton ':' <> showb c2)
{-# INLINE showb #-}
instance TextShow Hash where
showb = showb . FromStringShow
{-# INLINE showb #-}
$(deriveTextShow ''TixModule)
$(deriveTextShow ''CondBox)
$(deriveTextShow ''BoxLabel)
$(deriveTextShow ''Mix)
$(deriveTextShow ''Tix)