module Language.Haskell.TH.Instances () where
import Language.Haskell.TH.Syntax
import Language.Haskell.TH.Ppr
import Language.Haskell.TH.Lift (deriveLiftMany)
import GHC.Word ( Word8 )
deriving instance Show Loc
deriving instance Eq Loc
deriving instance Eq Info
instance Ord FixityDirection where
(<=) InfixL _ = True
(<=) _ InfixR = True
(<=) InfixN InfixN = True
(<=) _ _ = False
deriving instance Ord Info
deriving instance Ord Fixity
deriving instance Ord Exp
deriving instance Ord Dec
deriving instance Ord Stmt
deriving instance Ord Type
deriving instance Ord Foreign
deriving instance Ord FunDep
deriving instance Ord Con
deriving instance Ord Body
deriving instance Ord Clause
deriving instance Ord Strict
deriving instance Ord Safety
deriving instance Ord Callconv
deriving instance Ord Guard
deriving instance Ord Range
deriving instance Ord Match
deriving instance Ord Pat
deriving instance Ord Lit
#if MIN_VERSION_template_haskell(2,4,0)
deriving instance Ord FamFlavour
deriving instance Ord Pragma
deriving instance Ord Pred
deriving instance Ord TyVarBndr
#endif
#if MIN_VERSION_template_haskell(2,4,0) && !(MIN_VERSION_template_haskell(2,8,0))
deriving instance Ord InlineSpec
deriving instance Ord Kind
#endif
#if MIN_VERSION_template_haskell(2,5,0) && !(MIN_VERSION_template_haskell(2,7,0))
deriving instance Eq ClassInstance
deriving instance Ord ClassInstance
#endif
#if MIN_VERSION_template_haskell(2,8,0)
deriving instance Ord Inline
deriving instance Ord Phases
deriving instance Ord RuleBndr
deriving instance Ord RuleMatch
deriving instance Ord TyLit
#endif
#if MIN_VERSION_template_haskell(2,9,0)
deriving instance Ord AnnTarget
deriving instance Ord Role
deriving instance Ord TySynEqn
#endif
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)) |]
$(deriveLiftMany [ ''Body
, ''Callconv
, ''Clause
, ''Con
, ''Dec
, ''Exp
, ''Fixity
, ''FixityDirection
, ''Foreign
, ''FunDep
, ''Guard
, ''Info
, ''Lit
, ''Match
, ''Pat
, ''Range
, ''Safety
, ''Stmt
, ''Strict
, ''Type
#if MIN_VERSION_template_haskell(2,4,0)
, ''FamFlavour
, ''Pragma
, ''Pred
, ''TyVarBndr
#endif
#if MIN_VERSION_template_haskell(2,5,0) && !(MIN_VERSION_template_haskell(2,7,0))
, ''ClassInstance
#endif
#if MIN_VERSION_template_haskell(2,4,0) && !(MIN_VERSION_template_haskell(2,8,0))
, ''InlineSpec
, ''Kind
#endif
#if MIN_VERSION_template_haskell(2,8,0)
, ''Inline
, ''Phases
, ''RuleBndr
, ''RuleMatch
, ''TyLit
#endif
#if MIN_VERSION_template_haskell(2,9,0)
, ''AnnTarget
, ''Role
, ''TySynEqn
#endif
])