module Language.Haskell.TH.Instances () where
import GHC.Real (Ratio)
import Language.Haskell.TH
import Language.Haskell.TH.Instances.Internal
import Language.Haskell.TH.Lift (deriveLiftMany)
import Language.Haskell.TH.ReifyMany
import Language.Haskell.TH.Syntax
#if !MIN_VERSION_template_haskell(2,10,0)
import GHC.Word (Word8)
import Language.Haskell.TH.Ppr
deriving instance Show Loc
deriving instance Eq Loc
deriving instance Eq Info
instance Ord FixityDirection where
(<=) InfixL _ = True
(<=) _ InfixR = True
(<=) InfixN InfixN = True
(<=) _ _ = False
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)) |]
#endif
#if MIN_VERSION_template_haskell(2,5,0) && !(MIN_VERSION_template_haskell(2,7,0))
deriving instance Eq ClassInstance
#endif
$(reifyManyWithoutInstances ''Ord [''Info] (`notElem` [''Ratio]) >>=
mapM deriveOrd)
$(reifyManyWithoutInstances ''Lift [''Info] (const True) >>=
deriveLiftMany)