module Language.Haskell.TH.Instances () where
import GHC.Real (Ratio)
import GHC.Word (Word8)
import Language.Haskell.TH
import Language.Haskell.TH.Instances.Internal
import Language.Haskell.TH.Lift (deriveLiftMany)
import Language.Haskell.TH.Ppr
import Language.Haskell.TH.ReifyMany
import Language.Haskell.TH.Syntax
deriving instance Show Loc
deriving instance Eq Loc
deriving instance Eq Info
#if MIN_VERSION_template_haskell(2,5,0) && !(MIN_VERSION_template_haskell(2,7,0))
deriving instance Eq ClassInstance
#endif
instance Ord FixityDirection where
(<=) InfixL _ = True
(<=) _ InfixR = True
(<=) InfixN InfixN = True
(<=) _ _ = False
$(reifyManyWithoutInstances ''Ord [''Info] (`notElem` [''Ratio]) >>=
mapM deriveOrd)
instance Ppr Loc where
ppr = showtextl . show
instance Ppr Lit where
ppr l = ppr (LitE l)
instance Lift Word8 where
lift w = [e| fromIntegral $(lift (fromIntegral w :: Int)) |]
$(reifyManyWithoutInstances ''Lift [''Info] (const True) >>=
deriveLiftMany)