th-orphans-0.13.12: Orphan instances for TH datatypes

Copyright | (c) Matt Morrow 2008
License | BSD3
Maintainer | Michael Sloan <mgsloan at gmail>
Stability | experimental
Portability | portable (template-haskell)
Safe Haskell | None
Language | Haskell2010

Language.Haskell.TH.Instances

Contents

- Orphan instances

Description

It provides the following instances:

- `Ord`, `Lift`, `Generic`, `Show`, `Eq`, `Data`, `Typeable`, `Ppr`, instances for the datatypes in Language.Haskell.TH
- `Lift` instances for Data.Word / Data.Int types
- `Applicative` for `Q`
- `Quasi` for `ReaderT`, `WriterT`, `StateT`, and `RWST`.
- `Typeable` for `Lift`, `NameIs`, `Ppr`, `PprM`, `Q`, `Quasi`, `QuasiQuoter`, and `TExp`

More recent versions of template-haskell, particularly 2.10 (GHC 7.10), provide these instances. However, in order to support older versions you should import this module.

Note that the `Ord` instances are not guaranteed to produce consistent results across template-haskell / GHC versions, as they have different data types, with different constructor orders.

This module also implicitly re-exports the instances defined in Instances.TH.Lift. This is mostly to ensure that there aren't collisions of orphans between `th-orphans` and `th-lift-instances`.

# Orphan instances

MonadFix Q # | If the function passed to `mfix` inspects its argument, the resulting action will throw a `FixIOException` (`base >=4.11`) or a `BlockedIndefinitelyOnMVar` with older `base`.
Instance details Methods mfix :: (a -> Q a) -> Q a #
Lift Exp # |
Instance details Methods lift :: Exp -> Q Exp # liftTyped :: Exp -> Q (TExp Exp) #
Lift Match # |
Instance details Methods lift :: Match -> Q Exp # liftTyped :: Match -> Q (TExp Match) #
Lift Clause # |
Instance details Methods lift :: Clause -> Q Exp # liftTyped :: Clause -> Q (TExp Clause) #
Lift Pat # |
Instance details Methods lift :: Pat -> Q Exp # liftTyped :: Pat -> Q (TExp Pat) #
Lift Type # |
Instance details Methods lift :: Type -> Q Exp # liftTyped :: Type -> Q (TExp Type) #
Lift Dec # |
Instance details Methods lift :: Dec -> Q Exp # liftTyped :: Dec -> Q (TExp Dec) #
Lift FunDep # |
Instance details Methods lift :: FunDep -> Q Exp # liftTyped :: FunDep -> Q (TExp FunDep) #
Lift InjectivityAnn # |
Instance details Methods lift :: InjectivityAnn -> Q Exp # liftTyped :: InjectivityAnn -> Q (TExp InjectivityAnn) #
Lift Overlap # |
Instance details Methods lift :: Overlap -> Q Exp # liftTyped :: Overlap -> Q (TExp Overlap) #
Lift Loc # |
Instance details Methods lift :: Loc -> Q Exp # liftTyped :: Loc -> Q (TExp Loc) #
Lift Info # |
Instance details Methods lift :: Info -> Q Exp # liftTyped :: Info -> Q (TExp Info) #
Lift Fixity # |
Instance details Methods lift :: Fixity -> Q Exp # liftTyped :: Fixity -> Q (TExp Fixity) #
Lift FixityDirection # |
Instance details Methods lift :: FixityDirection -> Q Exp # liftTyped :: FixityDirection -> Q (TExp FixityDirection) #
Lift Lit # |
Instance details Methods lift :: Lit -> Q Exp # liftTyped :: Lit -> Q (TExp Lit) #
Lift Bytes # |
Instance details Methods lift :: Bytes -> Q Exp # liftTyped :: Bytes -> Q (TExp Bytes) #
Lift Body # |
Instance details Methods lift :: Body -> Q Exp # liftTyped :: Body -> Q (TExp Body) #
Lift Guard # |
Instance details Methods lift :: Guard -> Q Exp # liftTyped :: Guard -> Q (TExp Guard) #
Lift Stmt # |
Instance details Methods lift :: Stmt -> Q Exp # liftTyped :: Stmt -> Q (TExp Stmt) #
Lift Range # |
Instance details Methods lift :: Range -> Q Exp # liftTyped :: Range -> Q (TExp Range) #
Lift DerivClause # |
Instance details Methods lift :: DerivClause -> Q Exp # liftTyped :: DerivClause -> Q (TExp DerivClause) #
Lift DerivStrategy # |
Instance details Methods lift :: DerivStrategy -> Q Exp # liftTyped :: DerivStrategy -> Q (TExp DerivStrategy) #
Lift TypeFamilyHead # |
Instance details Methods lift :: TypeFamilyHead -> Q Exp # liftTyped :: TypeFamilyHead -> Q (TExp TypeFamilyHead) #
Lift TySynEqn # |
Instance details Methods lift :: TySynEqn -> Q Exp # liftTyped :: TySynEqn -> Q (TExp TySynEqn) #
Lift Foreign # |
Instance details Methods lift :: Foreign -> Q Exp # liftTyped :: Foreign -> Q (TExp Foreign) #
Lift Callconv # |
Instance details Methods lift :: Callconv -> Q Exp # liftTyped :: Callconv -> Q (TExp Callconv) #
Lift Safety # |
Instance details Methods lift :: Safety -> Q Exp # liftTyped :: Safety -> Q (TExp Safety) #
Lift Pragma # |
Instance details Methods lift :: Pragma -> Q Exp # liftTyped :: Pragma -> Q (TExp Pragma) #
Lift Inline # |
Instance details Methods lift :: Inline -> Q Exp # liftTyped :: Inline -> Q (TExp Inline) #
Lift RuleMatch # |
Instance details Methods lift :: RuleMatch -> Q Exp # liftTyped :: RuleMatch -> Q (TExp RuleMatch) #
Lift Phases # |
Instance details Methods lift :: Phases -> Q Exp # liftTyped :: Phases -> Q (TExp Phases) #
Lift RuleBndr # |
Instance details Methods lift :: RuleBndr -> Q Exp # liftTyped :: RuleBndr -> Q (TExp RuleBndr) #
Lift AnnTarget # |
Instance details Methods lift :: AnnTarget -> Q Exp # liftTyped :: AnnTarget -> Q (TExp AnnTarget) #
Lift SourceUnpackedness # |
Instance details Methods lift :: SourceUnpackedness -> Q Exp # liftTyped :: SourceUnpackedness -> Q (TExp SourceUnpackedness) #
Lift SourceStrictness # |
Instance details Methods lift :: SourceStrictness -> Q Exp # liftTyped :: SourceStrictness -> Q (TExp SourceStrictness) #
Lift Con # |
Instance details Methods lift :: Con -> Q Exp # liftTyped :: Con -> Q (TExp Con) #
Lift Bang # |
Instance details Methods lift :: Bang -> Q Exp # liftTyped :: Bang -> Q (TExp Bang) #
Lift PatSynDir # |
Instance details Methods lift :: PatSynDir -> Q Exp # liftTyped :: PatSynDir -> Q (TExp PatSynDir) #
Lift PatSynArgs # |
Instance details Methods lift :: PatSynArgs -> Q Exp # liftTyped :: PatSynArgs -> Q (TExp PatSynArgs) #
Lift TyVarBndr # |
Instance details Methods lift :: TyVarBndr -> Q Exp # liftTyped :: TyVarBndr -> Q (TExp TyVarBndr) #
Lift FamilyResultSig # |
Instance details Methods lift :: FamilyResultSig -> Q Exp # liftTyped :: FamilyResultSig -> Q (TExp FamilyResultSig) #
Lift TyLit # |
Instance details Methods lift :: TyLit -> Q Exp # liftTyped :: TyLit -> Q (TExp TyLit) #
Lift Role # |
Instance details Methods lift :: Role -> Q Exp # liftTyped :: Role -> Q (TExp Role) #
Semigroup a => Semigroup (Q a) # |
Instance details Methods (<>) :: Q a -> Q a -> Q a # sconcat :: NonEmpty (Q a) -> Q a # stimes :: Integral b => b -> Q a -> Q a #
Monoid a => Monoid (Q a) # |
Instance details Methods mempty :: Q a # mappend :: Q a -> Q a -> Q a # mconcat :: [Q a] -> Q a #
Quasi m => Quasi (ReaderT r m) # |
Instance details Methods qNewName :: String -> ReaderT r m Name # qReport :: Bool -> String -> ReaderT r m () # qRecover :: ReaderT r m a -> ReaderT r m a -> ReaderT r m a # qLookupName :: Bool -> String -> ReaderT r m (Maybe Name) # qReify :: Name -> ReaderT r m Info # qReifyFixity :: Name -> ReaderT r m (Maybe Fixity) # qReifyType :: Name -> ReaderT r m Type # qReifyInstances :: Name -> [Type] -> ReaderT r m [Dec] # qReifyRoles :: Name -> ReaderT r m [Role] # qReifyAnnotations :: Data a => AnnLookup -> ReaderT r m [a] # qReifyModule :: Module -> ReaderT r m ModuleInfo # qReifyConStrictness :: Name -> ReaderT r m [DecidedStrictness] # qLocation :: ReaderT r m Loc # qRunIO :: IO a -> ReaderT r m a # qAddDependentFile :: FilePath -> ReaderT r m () # qAddTempFile :: String -> ReaderT r m FilePath # qAddTopDecls :: [Dec] -> ReaderT r m () # qAddForeignFilePath :: ForeignSrcLang -> String -> ReaderT r m () # qAddModFinalizer :: Q () -> ReaderT r m () # qAddCorePlugin :: String -> ReaderT r m () # qGetQ :: Typeable a => ReaderT r m (Maybe a) # qPutQ :: Typeable a => a -> ReaderT r m () # qIsExtEnabled :: Extension -> ReaderT r m Bool # qExtsEnabled :: ReaderT r m [Extension] #
Quasi m => Quasi (StateT s m) # |
Instance details Methods qNewName :: String -> StateT s m Name # qReport :: Bool -> String -> StateT s m () # qRecover :: StateT s m a -> StateT s m a -> StateT s m a # qLookupName :: Bool -> String -> StateT s m (Maybe Name) # qReify :: Name -> StateT s m Info # qReifyFixity :: Name -> StateT s m (Maybe Fixity) # qReifyType :: Name -> StateT s m Type # qReifyInstances :: Name -> [Type] -> StateT s m [Dec] # qReifyRoles :: Name -> StateT s m [Role] # qReifyAnnotations :: Data a => AnnLookup -> StateT s m [a] # qReifyModule :: Module -> StateT s m ModuleInfo # qReifyConStrictness :: Name -> StateT s m [DecidedStrictness] # qLocation :: StateT s m Loc # qRunIO :: IO a -> StateT s m a # qAddDependentFile :: FilePath -> StateT s m () # qAddTempFile :: String -> StateT s m FilePath # qAddTopDecls :: [Dec] -> StateT s m () # qAddForeignFilePath :: ForeignSrcLang -> String -> StateT s m () # qAddModFinalizer :: Q () -> StateT s m () # qAddCorePlugin :: String -> StateT s m () # qGetQ :: Typeable a => StateT s m (Maybe a) # qPutQ :: Typeable a => a -> StateT s m () # qIsExtEnabled :: Extension -> StateT s m Bool # qExtsEnabled :: StateT s m [Extension] #
(Quasi m, Monoid w) => Quasi (WriterT w m) # |
Instance details Methods qNewName :: String -> WriterT w m Name # qReport :: Bool -> String -> WriterT w m () # qRecover :: WriterT w m a -> WriterT w m a -> WriterT w m a # qLookupName :: Bool -> String -> WriterT w m (Maybe Name) # qReify :: Name -> WriterT w m Info # qReifyFixity :: Name -> WriterT w m (Maybe Fixity) # qReifyType :: Name -> WriterT w m Type # qReifyInstances :: Name -> [Type] -> WriterT w m [Dec] # qReifyRoles :: Name -> WriterT w m [Role] # qReifyAnnotations :: Data a => AnnLookup -> WriterT w m [a] # qReifyModule :: Module -> WriterT w m ModuleInfo # qReifyConStrictness :: Name -> WriterT w m [DecidedStrictness] # qLocation :: WriterT w m Loc # qRunIO :: IO a -> WriterT w m a # qAddDependentFile :: FilePath -> WriterT w m () # qAddTempFile :: String -> WriterT w m FilePath # qAddTopDecls :: [Dec] -> WriterT w m () # qAddForeignFilePath :: ForeignSrcLang -> String -> WriterT w m () # qAddModFinalizer :: Q () -> WriterT w m () # qAddCorePlugin :: String -> WriterT w m () # qGetQ :: Typeable a => WriterT w m (Maybe a) # qPutQ :: Typeable a => a -> WriterT w m () # qIsExtEnabled :: Extension -> WriterT w m Bool # qExtsEnabled :: WriterT w m [Extension] #
Quote m => Quote (ReaderT r m) # |
Instance details Methods newName :: String -> ReaderT r m Name #
Quote m => Quote (StateT s m) # |
Instance details Methods newName :: String -> StateT s m Name #
(Quote m, Monoid w) => Quote (WriterT w m) # |
Instance details Methods newName :: String -> WriterT w m Name #
(Quasi m, Monoid w) => Quasi (RWST r w s m) # |
Instance details Methods qNewName :: String -> RWST r w s m Name # qReport :: Bool -> String -> RWST r w s m () # qRecover :: RWST r w s m a -> RWST r w s m a -> RWST r w s m a # qLookupName :: Bool -> String -> RWST r w s m (Maybe Name) # qReify :: Name -> RWST r w s m Info # qReifyFixity :: Name -> RWST r w s m (Maybe Fixity) # qReifyType :: Name -> RWST r w s m Type # qReifyInstances :: Name -> [Type] -> RWST r w s m [Dec] # qReifyRoles :: Name -> RWST r w s m [Role] # qReifyAnnotations :: Data a => AnnLookup -> RWST r w s m [a] # qReifyModule :: Module -> RWST r w s m ModuleInfo # qReifyConStrictness :: Name -> RWST r w s m [DecidedStrictness] # qLocation :: RWST r w s m Loc # qRunIO :: IO a -> RWST r w s m a # qAddDependentFile :: FilePath -> RWST r w s m () # qAddTempFile :: String -> RWST r w s m FilePath # qAddTopDecls :: [Dec] -> RWST r w s m () # qAddForeignFilePath :: ForeignSrcLang -> String -> RWST r w s m () # qAddModFinalizer :: Q () -> RWST r w s m () # qAddCorePlugin :: String -> RWST r w s m () # qGetQ :: Typeable a => RWST r w s m (Maybe a) # qPutQ :: Typeable a => a -> RWST r w s m () # qIsExtEnabled :: Extension -> RWST r w s m Bool # qExtsEnabled :: RWST r w s m [Extension] #
(Quote m, Monoid w) => Quote (RWST r w s m) # |
Instance details Methods newName :: String -> RWST r w s m Name #