th-desugar-1.9: Functions to desugar Template Haskell

Copyright | (C) 2014 Richard Eisenberg
License | BSD-style (see LICENSE)
Maintainer | Ryan Scott
Stability | experimental
Portability | non-portable
Safe Haskell | None
Language | Haskell2010

Language.Haskell.TH.Desugar

Contents

- Desugared data types
- The `Desugar` class
- Main desugaring functions
  - Secondary desugaring functions
- Converting desugared AST back to TH AST
- Expanding type synonyms
- Reification
- Nested pattern flattening
- Capture-avoiding substitution and utilities
- Utility functions
  - Extracting bound names

Description

Desugars full Template Haskell syntax into a smaller core syntax for further processing.

Synopsis

- data DExp
  - = DVarE Name
  - | DConE Name
  - | DLitE Lit
  - | DAppE DExp DExp
  - | DAppTypeE DExp DType
  - | DLamE [Name] DExp
  - | DCaseE DExp [DMatch]
  - | DLetE [DLetDec] DExp
  - | DSigE DExp DType
  - | DStaticE DExp
- data DLetDec
  - = DFunD Name [DClause]
  - | DValD DPat DExp
  - | DSigD Name DType
  - | DInfixD Fixity Name
  - | DPragmaD DPragma
- data DPat
  - = DLitPa Lit
  - | DVarPa Name
  - | DConPa Name [DPat]
  - | DTildePa DPat
  - | DBangPa DPat
  - | DSigPa DPat DType
  - | DWildPa
- data DType
  - = DForallT [DTyVarBndr] DCxt DType
  - | DAppT DType DType
  - | DSigT DType DKind
  - | DVarT Name
  - | DConT Name
  - | DArrowT
  - | DLitT TyLit
  - | DWildCardT
- type DKind = DType
- type DCxt = [DPred]
- data DPred
  - = DForallPr [DTyVarBndr] DCxt DPred
  - | DAppPr DPred DType
  - | DSigPr DPred DKind
  - | DVarPr Name
  - | DConPr Name
  - | DWildCardPr
- data DTyVarBndr
  - = DPlainTV Name
  - | DKindedTV Name DKind
- data DMatch = DMatch DPat DExp
- data DClause = DClause [DPat] DExp
- data DDec
  - = DLetDec DLetDec
  - | DDataD NewOrData DCxt Name [DTyVarBndr] (Maybe DKind) [DCon] [DDerivClause]
  - | DTySynD Name [DTyVarBndr] DType
  - | DClassD DCxt Name [DTyVarBndr] [FunDep] [DDec]
  - | DInstanceD (Maybe Overlap) DCxt DType [DDec]
  - | DForeignD DForeign
  - | DOpenTypeFamilyD DTypeFamilyHead
  - | DClosedTypeFamilyD DTypeFamilyHead [DTySynEqn]
  - | DDataFamilyD Name [DTyVarBndr] (Maybe DKind)
  - | DDataInstD NewOrData DCxt Name [DType] (Maybe DKind) [DCon] [DDerivClause]
  - | DTySynInstD Name DTySynEqn
  - | DRoleAnnotD Name [Role]
  - | DStandaloneDerivD (Maybe DDerivStrategy) DCxt DType
  - | DDefaultSigD Name DType
  - | DPatSynD Name PatSynArgs DPatSynDir DPat
  - | DPatSynSigD Name DPatSynType
- data DDerivClause = DDerivClause (Maybe DDerivStrategy) DCxt
- data DDerivStrategy
  - = DStockStrategy
  - | DAnyclassStrategy
  - | DNewtypeStrategy
  - | DViaStrategy DType
- data DPatSynDir
  - = DUnidir
  - | DImplBidir
  - | DExplBidir [DClause]
- type DPatSynType = DType
- data Overlap
  - = Overlappable
  - | Overlapping
  - | Overlaps
  - | Incoherent
- data PatSynArgs
  - = PrefixPatSyn [Name]
  - | InfixPatSyn Name Name
  - | RecordPatSyn [Name]
- data NewOrData
  - = Newtype
  - | Data
- data DTypeFamilyHead = DTypeFamilyHead Name [DTyVarBndr] DFamilyResultSig (Maybe InjectivityAnn)
- data DFamilyResultSig
  - = DNoSig
  - | DKindSig DKind
  - | DTyVarSig DTyVarBndr
- data InjectivityAnn = InjectivityAnn Name [Name]
- data DCon = DCon [DTyVarBndr] DCxt Name DConFields DType
- data DConFields
  - = DNormalC DDeclaredInfix [DBangType]
  - | DRecC [DVarBangType]
- type DDeclaredInfix = Bool
- type DBangType = (Bang, DType)
- type DVarBangType = (Name, Bang, DType)
- data Bang = Bang SourceUnpackedness SourceStrictness
- data SourceUnpackedness
  - = NoSourceUnpackedness
  - | SourceNoUnpack
  - | SourceUnpack
- data SourceStrictness
  - = NoSourceStrictness
  - | SourceLazy
  - | SourceStrict
- data DForeign
  - = DImportF Callconv Safety String Name DType
  - | DExportF Callconv String Name DType
- data DPragma
  - = DInlineP Name Inline RuleMatch Phases
  - | DSpecialiseP Name DType (Maybe Inline) Phases
  - | DSpecialiseInstP DType
  - | DRuleP String [DRuleBndr] DExp DExp Phases
  - | DAnnP AnnTarget DExp
  - | DLineP Int String
  - | DCompleteP [Name] (Maybe Name)
- data DRuleBndr
  - = DRuleVar Name
  - | DTypedRuleVar Name DType
- data DTySynEqn = DTySynEqn [DType] DType
- data DInfo
  - = DTyConI DDec (Maybe [DInstanceDec])
  - | DVarI Name DType (Maybe Name)
  - | DTyVarI Name DKind
  - | DPrimTyConI Name Int Bool
  - | DPatSynI Name DPatSynType
- type DInstanceDec = DDec
- data Role
  - = NominalR
  - | RepresentationalR
  - | PhantomR
  - | InferR
- data AnnTarget
  - = ModuleAnnotation
  - | TypeAnnotation Name
  - | ValueAnnotation Name
- class Desugar th ds | ds -> th where
  - desugar :: DsMonad q => th -> q ds
  - sweeten :: ds -> th
- dsExp :: DsMonad q => Exp -> q DExp
- dsDecs :: DsMonad q => [Dec] -> q [DDec]
- dsType :: DsMonad q => Type -> q DType
- dsInfo :: DsMonad q => Info -> q DInfo
- dsPatOverExp :: DsMonad q => Pat -> DExp -> q (DPat, DExp)
- dsPatsOverExp :: DsMonad q => [Pat] -> DExp -> q ([DPat], DExp)
- dsPatX :: DsMonad q => Pat -> q (DPat, [(Name, DExp)])
- dsLetDecs :: DsMonad q => [Dec] -> q [DLetDec]
- dsTvb :: DsMonad q => TyVarBndr -> q DTyVarBndr
- dsCxt :: DsMonad q => Cxt -> q DCxt
- dsCon :: DsMonad q => [DTyVarBndr] -> DType -> Con -> q [DCon]
- dsForeign :: DsMonad q => Foreign -> q DForeign
- dsPragma :: DsMonad q => Pragma -> q DPragma
- dsRuleBndr :: DsMonad q => RuleBndr -> q DRuleBndr
- type PatM q = WriterT [(Name, DExp)] q
- dsPred :: DsMonad q => Pred -> q DCxt
- dsPat :: DsMonad q => Pat -> PatM q DPat
- dsDec :: DsMonad q => Dec -> q [DDec]
- dsDerivClause :: DsMonad q => DerivClause -> q DDerivClause
- dsLetDec :: DsMonad q => Dec -> q [DLetDec]
- dsMatches :: DsMonad q => Name -> [Match] -> q [DMatch]
- dsBody :: DsMonad q => Body -> [Dec] -> DExp -> q DExp
- dsGuards :: DsMonad q => [(Guard, Exp)] -> DExp -> q DExp
- dsDoStmts :: DsMonad q => [Stmt] -> q DExp
- dsComp :: DsMonad q => [Stmt] -> q DExp
- dsClauses :: DsMonad q => Name -> [Clause] -> q [DClause]
- dsBangType :: DsMonad q => BangType -> q DBangType
- dsVarBangType :: DsMonad q => VarBangType -> q DVarBangType
- dsTypeFamilyHead :: DsMonad q => TypeFamilyHead -> q DTypeFamilyHead
- dsFamilyResultSig :: DsMonad q => FamilyResultSig -> q DFamilyResultSig
- dsPatSynDir :: DsMonad q => Name -> PatSynDir -> q DPatSynDir
- module Language.Haskell.TH.Desugar.Sweeten
- expand :: (DsMonad q, Data a) => a -> q a
- expandType :: DsMonad q => DType -> q DType
- reifyWithWarning :: Quasi q => Name -> q Info
- withLocalDeclarations :: DsMonad q => [Dec] -> DsM q a -> q a
- dsReify :: DsMonad q => Name -> q (Maybe DInfo)
- reifyWithLocals_maybe :: DsMonad q => Name -> q (Maybe Info)
- reifyWithLocals :: DsMonad q => Name -> q Info
- reifyFixityWithLocals :: DsMonad q => Name -> q (Maybe Fixity)
- lookupValueNameWithLocals :: DsMonad q => String -> q (Maybe Name)
- lookupTypeNameWithLocals :: DsMonad q => String -> q (Maybe Name)
- mkDataNameWithLocals :: DsMonad q => String -> q Name
- mkTypeNameWithLocals :: DsMonad q => String -> q Name
- reifyNameSpace :: DsMonad q => Name -> q (Maybe NameSpace)
- class Quasi m => DsMonad m where
  - localDeclarations :: m [Dec]
- data DsM q a
- scExp :: DsMonad q => DExp -> q DExp
- scLetDec :: DsMonad q => DLetDec -> q DLetDec
- module Language.Haskell.TH.Desugar.Subst
- applyDExp :: DExp -> [DExp] -> DExp
- applyDType :: DType -> [DType] -> DType
- dPatToDExp :: DPat -> DExp
- removeWilds :: DsMonad q => DPat -> q DPat
- getDataD :: DsMonad q => String -> Name -> q ([TyVarBndr], [Con])
- dataConNameToDataName :: DsMonad q => Name -> q Name
- dataConNameToCon :: DsMonad q => Name -> q Con
- nameOccursIn :: Data a => Name -> a -> Bool
- allNamesIn :: Data a => a -> [Name]
- flattenDValD :: Quasi q => DLetDec -> q [DLetDec]
- getRecordSelectors :: Quasi q => DType -> [DCon] -> q [DLetDec]
- mkTypeName :: Quasi q => String -> q Name
- mkDataName :: Quasi q => String -> q Name
- newUniqueName :: Quasi q => String -> q Name
- mkTupleDExp :: [DExp] -> DExp
- mkTupleDPat :: [DPat] -> DPat
- maybeDLetE :: [DLetDec] -> DExp -> DExp
- maybeDCaseE :: String -> DExp -> [DMatch] -> DExp
- mkDLamEFromDPats :: DsMonad q => [DPat] -> DExp -> q DExp
- fvDType :: DType -> Set Name
- tupleDegree_maybe :: String -> Maybe Int
- tupleNameDegree_maybe :: Name -> Maybe Int
- unboxedSumDegree_maybe :: String -> Maybe Int
- unboxedSumNameDegree_maybe :: Name -> Maybe Int
- unboxedTupleDegree_maybe :: String -> Maybe Int
- unboxedTupleNameDegree_maybe :: Name -> Maybe Int
- strictToBang :: Bang -> Bang
- isTypeKindName :: Name -> Bool
- typeKindName :: Name
- unravel :: DType -> ([DTyVarBndr], [DPred], [DType], DType)
- conExistentialTvbs :: DsMonad q => DType -> DCon -> q [DTyVarBndr]
- mkExtraDKindBinders :: DsMonad q => DKind -> q [DTyVarBndr]
- dTyVarBndrToDType :: DTyVarBndr -> DType
- toposortTyVarsOf :: [DType] -> [DTyVarBndr]
- extractBoundNamesStmt :: Stmt -> Set Name
- extractBoundNamesDec :: Dec -> Set Name
- extractBoundNamesPat :: Pat -> Set Name

# Desugared data types

data DExp Source #

Corresponds to TH's `Exp` type. Note that `DLamE` takes names, not patterns.

Constructors

DVarE Name |
DConE Name |
DLitE Lit |
DAppE DExp DExp |
DAppTypeE DExp DType |
DLamE [Name] DExp |
DCaseE DExp [DMatch] |
DLetE [DLetDec] DExp |
DSigE DExp DType |
DStaticE DExp |

Instances

Data DExp Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DExp -> c DExp Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DExp Source #

toConstr :: DExp -> Constr Source #

dataTypeOf :: DExp -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DExp) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DExp) Source #

gmapT :: (forall b. Data b => b -> b) -> DExp -> DExp Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DExp -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DExp -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> DExp -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DExp -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DExp -> m DExp Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DExp -> m DExp Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DExp -> m DExp Source #

Show DExp Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Methods showsPrec :: Int -> DExp -> ShowS Source # show :: DExp -> String Source # showList :: [DExp] -> ShowS Source #
Generic DExp Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Associated Types type Rep DExp :: Type -> Type Source # Methods from :: DExp -> Rep DExp x Source # to :: Rep DExp x -> DExp Source #
Lift DExp Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Lift Methods lift :: DExp -> Q Exp Source #
Desugar Exp DExp Source # |
Instance details Defined in Language.Haskell.TH.Desugar Methods desugar :: DsMonad q => Exp -> q DExp Source # sweeten :: DExp -> Exp Source #
type Rep DExp Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

type Rep DExp = D1 (MetaData "DExp" "Language.Haskell.TH.Desugar.AST" "th-desugar-1.9-5oEkqzRynNEJ8Qz3c6iqXN" False) (((C1 (MetaCons "DVarE" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name)) :+: C1 (MetaCons "DConE" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name))) :+: (C1 (MetaCons "DLitE" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Lit)) :+: (C1 (MetaCons "DAppE" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DExp) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DExp)) :+: C1 (MetaCons "DAppTypeE" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DExp) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DType))))) :+: ((C1 (MetaCons "DLamE" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Name]) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DExp)) :+: C1 (MetaCons "DCaseE" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DExp) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [DMatch]))) :+: (C1 (MetaCons "DLetE" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [DLetDec]) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DExp)) :+: (C1 (MetaCons "DSigE" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DExp) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DType)) :+: C1 (MetaCons "DStaticE" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DExp))))))

data DLetDec Source #

Declarations as used in a `let` statement.

Constructors

DFunD Name [DClause] |
DValD DPat DExp |
DSigD Name DType |
DInfixD Fixity Name |
DPragmaD DPragma |

Instances

Data DLetDec Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DLetDec -> c DLetDec Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DLetDec Source #

toConstr :: DLetDec -> Constr Source #

dataTypeOf :: DLetDec -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DLetDec) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DLetDec) Source #

gmapT :: (forall b. Data b => b -> b) -> DLetDec -> DLetDec Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DLetDec -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DLetDec -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> DLetDec -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DLetDec -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DLetDec -> m DLetDec Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DLetDec -> m DLetDec Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DLetDec -> m DLetDec Source #

Show DLetDec Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Methods showsPrec :: Int -> DLetDec -> ShowS Source # show :: DLetDec -> String Source # showList :: [DLetDec] -> ShowS Source #
Generic DLetDec Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Associated Types type Rep DLetDec :: Type -> Type Source # Methods from :: DLetDec -> Rep DLetDec x Source # to :: Rep DLetDec x -> DLetDec Source #
Lift DLetDec Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Lift Methods lift :: DLetDec -> Q Exp Source #
type Rep DLetDec Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

type Rep DLetDec = D1 (MetaData "DLetDec" "Language.Haskell.TH.Desugar.AST" "th-desugar-1.9-5oEkqzRynNEJ8Qz3c6iqXN" False) ((C1 (MetaCons "DFunD" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [DClause])) :+: C1 (MetaCons "DValD" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DPat) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DExp))) :+: (C1 (MetaCons "DSigD" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DType)) :+: (C1 (MetaCons "DInfixD" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Fixity) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name)) :+: C1 (MetaCons "DPragmaD" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DPragma)))))

data DPat Source #

Corresponds to TH's `Pat` type.

Constructors

DLitPa Lit |
DVarPa Name |
DConPa Name [DPat] |
DTildePa DPat |
DBangPa DPat |
DSigPa DPat DType |
DWildPa |

Instances

Data DPat Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DPat -> c DPat Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DPat Source #

toConstr :: DPat -> Constr Source #

dataTypeOf :: DPat -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DPat) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DPat) Source #

gmapT :: (forall b. Data b => b -> b) -> DPat -> DPat Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DPat -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DPat -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> DPat -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DPat -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DPat -> m DPat Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DPat -> m DPat Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DPat -> m DPat Source #

Show DPat Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Methods showsPrec :: Int -> DPat -> ShowS Source # show :: DPat -> String Source # showList :: [DPat] -> ShowS Source #
Generic DPat Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Associated Types type Rep DPat :: Type -> Type Source # Methods from :: DPat -> Rep DPat x Source # to :: Rep DPat x -> DPat Source #
Lift DPat Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Lift Methods lift :: DPat -> Q Exp Source #
type Rep DPat Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

type Rep DPat = D1 (MetaData "DPat" "Language.Haskell.TH.Desugar.AST" "th-desugar-1.9-5oEkqzRynNEJ8Qz3c6iqXN" False) ((C1 (MetaCons "DLitPa" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Lit)) :+: (C1 (MetaCons "DVarPa" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name)) :+: C1 (MetaCons "DConPa" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [DPat])))) :+: ((C1 (MetaCons "DTildePa" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DPat)) :+: C1 (MetaCons "DBangPa" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DPat))) :+: (C1 (MetaCons "DSigPa" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DPat) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DType)) :+: C1 (MetaCons "DWildPa" PrefixI False) (U1 :: Type -> Type))))

data DType Source #

Corresponds to TH's `Type` type, used to represent types and kinds.

Constructors

DForallT [DTyVarBndr] DCxt DType |
DAppT DType DType |
DSigT DType DKind |
DVarT Name |
DConT Name |
DArrowT |
DLitT TyLit |
DWildCardT |

Instances

Data DType Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DType -> c DType Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DType Source #

toConstr :: DType -> Constr Source #

dataTypeOf :: DType -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DType) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DType) Source #

gmapT :: (forall b. Data b => b -> b) -> DType -> DType Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DType -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DType -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> DType -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DType -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DType -> m DType Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DType -> m DType Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DType -> m DType Source #

Show DType Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Methods showsPrec :: Int -> DType -> ShowS Source # show :: DType -> String Source # showList :: [DType] -> ShowS Source #
Generic DType Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Associated Types type Rep DType :: Type -> Type Source # Methods from :: DType -> Rep DType x Source # to :: Rep DType x -> DType Source #
Lift DType Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Lift Methods lift :: DType -> Q Exp Source #
Desugar Type DType Source # |
Instance details Defined in Language.Haskell.TH.Desugar Methods desugar :: DsMonad q => Type -> q DType Source # sweeten :: DType -> Type Source #
type Rep DType Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

type Rep DType = D1 (MetaData "DType" "Language.Haskell.TH.Desugar.AST" "th-desugar-1.9-5oEkqzRynNEJ8Qz3c6iqXN" False) (((C1 (MetaCons "DForallT" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [DTyVarBndr]) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DCxt) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DType))) :+: C1 (MetaCons "DAppT" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DType) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DType))) :+: (C1 (MetaCons "DSigT" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DType) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DKind)) :+: C1 (MetaCons "DVarT" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name)))) :+: ((C1 (MetaCons "DConT" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name)) :+: C1 (MetaCons "DArrowT" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "DLitT" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 TyLit)) :+: C1 (MetaCons "DWildCardT" PrefixI False) (U1 :: Type -> Type))))

type DKind = DType Source #

Kinds are types.

type DCxt = [DPred] Source #

Corresponds to TH's `Cxt`

data DPred Source #

Corresponds to TH's `Pred`

Constructors

DForallPr [DTyVarBndr] DCxt DPred |
DAppPr DPred DType |
DSigPr DPred DKind |
DVarPr Name |
DConPr Name |
DWildCardPr |

Instances

Data DPred Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DPred -> c DPred Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DPred Source #

toConstr :: DPred -> Constr Source #

dataTypeOf :: DPred -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DPred) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DPred) Source #

gmapT :: (forall b. Data b => b -> b) -> DPred -> DPred Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DPred -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DPred -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> DPred -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DPred -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DPred -> m DPred Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DPred -> m DPred Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DPred -> m DPred Source #

Show DPred Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Methods showsPrec :: Int -> DPred -> ShowS Source # show :: DPred -> String Source # showList :: [DPred] -> ShowS Source #
Generic DPred Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Associated Types type Rep DPred :: Type -> Type Source # Methods from :: DPred -> Rep DPred x Source # to :: Rep DPred x -> DPred Source #
Lift DPred Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Lift Methods lift :: DPred -> Q Exp Source #
Desugar Cxt DCxt Source # |
Instance details Defined in Language.Haskell.TH.Desugar Methods desugar :: DsMonad q => Cxt -> q DCxt Source # sweeten :: DCxt -> Cxt Source #
type Rep DPred Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

type Rep DPred = D1 (MetaData "DPred" "Language.Haskell.TH.Desugar.AST" "th-desugar-1.9-5oEkqzRynNEJ8Qz3c6iqXN" False) ((C1 (MetaCons "DForallPr" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [DTyVarBndr]) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DCxt) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DPred))) :+: (C1 (MetaCons "DAppPr" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DPred) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DType)) :+: C1 (MetaCons "DSigPr" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DPred) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DKind)))) :+: (C1 (MetaCons "DVarPr" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name)) :+: (C1 (MetaCons "DConPr" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name)) :+: C1 (MetaCons "DWildCardPr" PrefixI False) (U1 :: Type -> Type))))

data DTyVarBndr Source #

Corresponds to TH's `TyVarBndr`

Constructors

DPlainTV Name |
DKindedTV Name DKind |

Instances

Data DTyVarBndr Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DTyVarBndr -> c DTyVarBndr Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DTyVarBndr Source #

toConstr :: DTyVarBndr -> Constr Source #

dataTypeOf :: DTyVarBndr -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DTyVarBndr) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DTyVarBndr) Source #

gmapT :: (forall b. Data b => b -> b) -> DTyVarBndr -> DTyVarBndr Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DTyVarBndr -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DTyVarBndr -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> DTyVarBndr -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DTyVarBndr -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DTyVarBndr -> m DTyVarBndr Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DTyVarBndr -> m DTyVarBndr Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DTyVarBndr -> m DTyVarBndr Source #

Show DTyVarBndr Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Methods showsPrec :: Int -> DTyVarBndr -> ShowS Source # show :: DTyVarBndr -> String Source # showList :: [DTyVarBndr] -> ShowS Source #
Generic DTyVarBndr Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Associated Types type Rep DTyVarBndr :: Type -> Type Source # Methods from :: DTyVarBndr -> Rep DTyVarBndr x Source # to :: Rep DTyVarBndr x -> DTyVarBndr Source #
Lift DTyVarBndr Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Lift Methods lift :: DTyVarBndr -> Q Exp Source #
Desugar TyVarBndr DTyVarBndr Source # |
Instance details Defined in Language.Haskell.TH.Desugar Methods desugar :: DsMonad q => TyVarBndr -> q DTyVarBndr Source # sweeten :: DTyVarBndr -> TyVarBndr Source #
type Rep DTyVarBndr Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

type Rep DTyVarBndr = D1 (MetaData "DTyVarBndr" "Language.Haskell.TH.Desugar.AST" "th-desugar-1.9-5oEkqzRynNEJ8Qz3c6iqXN" False) (C1 (MetaCons "DPlainTV" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name)) :+: C1 (MetaCons "DKindedTV" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DKind)))

data DMatch Source #

Corresponds to TH's `Match` type.

Constructors

DMatch DPat DExp |

Instances

Data DMatch Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DMatch -> c DMatch Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DMatch Source #

toConstr :: DMatch -> Constr Source #

dataTypeOf :: DMatch -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DMatch) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DMatch) Source #

gmapT :: (forall b. Data b => b -> b) -> DMatch -> DMatch Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DMatch -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DMatch -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> DMatch -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DMatch -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DMatch -> m DMatch Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DMatch -> m DMatch Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DMatch -> m DMatch Source #

Show DMatch Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Methods showsPrec :: Int -> DMatch -> ShowS Source # show :: DMatch -> String Source # showList :: [DMatch] -> ShowS Source #
Generic DMatch Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Associated Types type Rep DMatch :: Type -> Type Source # Methods from :: DMatch -> Rep DMatch x Source # to :: Rep DMatch x -> DMatch Source #
Lift DMatch Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Lift Methods lift :: DMatch -> Q Exp Source #
type Rep DMatch Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

type Rep DMatch = D1 (MetaData "DMatch" "Language.Haskell.TH.Desugar.AST" "th-desugar-1.9-5oEkqzRynNEJ8Qz3c6iqXN" False) (C1 (MetaCons "DMatch" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DPat) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DExp)))

data DClause Source #

Corresponds to TH's `Clause` type.

Constructors

DClause [DPat] DExp |

Instances

Data DClause Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DClause -> c DClause Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DClause Source #

toConstr :: DClause -> Constr Source #

dataTypeOf :: DClause -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DClause) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DClause) Source #

gmapT :: (forall b. Data b => b -> b) -> DClause -> DClause Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DClause -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DClause -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> DClause -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DClause -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DClause -> m DClause Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DClause -> m DClause Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DClause -> m DClause Source #

Show DClause Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Methods showsPrec :: Int -> DClause -> ShowS Source # show :: DClause -> String Source # showList :: [DClause] -> ShowS Source #
Generic DClause Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Associated Types type Rep DClause :: Type -> Type Source # Methods from :: DClause -> Rep DClause x Source # to :: Rep DClause x -> DClause Source #
Lift DClause Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Lift Methods lift :: DClause -> Q Exp Source #
type Rep DClause Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

type Rep DClause = D1 (MetaData "DClause" "Language.Haskell.TH.Desugar.AST" "th-desugar-1.9-5oEkqzRynNEJ8Qz3c6iqXN" False) (C1 (MetaCons "DClause" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [DPat]) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DExp)))

data DDec Source #

Corresponds to TH's `Dec` type.

Constructors

DLetDec DLetDec |
DDataD NewOrData DCxt Name [DTyVarBndr] (Maybe DKind) [DCon] [DDerivClause] |
DTySynD Name [DTyVarBndr] DType |
DClassD DCxt Name [DTyVarBndr] [FunDep] [DDec] |
DInstanceD (Maybe Overlap) DCxt DType [DDec] |
DForeignD DForeign |
DOpenTypeFamilyD DTypeFamilyHead |
DClosedTypeFamilyD DTypeFamilyHead [DTySynEqn] |
DDataFamilyD Name [DTyVarBndr] (Maybe DKind) |
DDataInstD NewOrData DCxt Name [DType] (Maybe DKind) [DCon] [DDerivClause] |
DTySynInstD Name DTySynEqn |
DRoleAnnotD Name [Role] |
DStandaloneDerivD (Maybe DDerivStrategy) DCxt DType |
DDefaultSigD Name DType |
DPatSynD Name PatSynArgs DPatSynDir DPat |
DPatSynSigD Name DPatSynType |

Instances

Data DDec Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DDec -> c DDec Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DDec Source #

toConstr :: DDec -> Constr Source #

dataTypeOf :: DDec -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DDec) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DDec) Source #

gmapT :: (forall b. Data b => b -> b) -> DDec -> DDec Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DDec -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DDec -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> DDec -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DDec -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DDec -> m DDec Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DDec -> m DDec Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DDec -> m DDec Source #

Show DDec Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Methods showsPrec :: Int -> DDec -> ShowS Source # show :: DDec -> String Source # showList :: [DDec] -> ShowS Source #
Generic DDec Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Associated Types type Rep DDec :: Type -> Type Source # Methods from :: DDec -> Rep DDec x Source # to :: Rep DDec x -> DDec Source #
Lift DDec Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Lift Methods lift :: DDec -> Q Exp Source #
Desugar [Dec] [DDec] Source # |
Instance details Defined in Language.Haskell.TH.Desugar Methods desugar :: DsMonad q => [Dec] -> q [DDec] Source # sweeten :: [DDec] -> [Dec] Source #
type Rep DDec Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

type Rep DDec = D1 (MetaData "DDec" "Language.Haskell.TH.Desugar.AST" "th-desugar-1.9-5oEkqzRynNEJ8Qz3c6iqXN" False) ((((C1 (MetaCons "DLetDec" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DLetDec)) :+: C1 (MetaCons "DDataD" PrefixI False) ((S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 NewOrData) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DCxt) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name))) :*: ((S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [DTyVarBndr]) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe DKind))) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [DCon]) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [DDerivClause]))))) :+: (C1 (MetaCons "DTySynD" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [DTyVarBndr]) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DType))) :+: C1 (MetaCons "DClassD" PrefixI False) ((S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DCxt) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name)) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [DTyVarBndr]) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [FunDep]) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [DDec])))))) :+: ((C1 (MetaCons "DInstanceD" PrefixI False) ((S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Overlap)) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DCxt)) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DType) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [DDec]))) :+: C1 (MetaCons "DForeignD" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DForeign))) :+: (C1 (MetaCons "DOpenTypeFamilyD" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DTypeFamilyHead)) :+: C1 (MetaCons "DClosedTypeFamilyD" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DTypeFamilyHead) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [DTySynEqn]))))) :+: (((C1 (MetaCons "DDataFamilyD" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [DTyVarBndr]) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe DKind)))) :+: C1 (MetaCons "DDataInstD" PrefixI False) ((S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 NewOrData) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DCxt) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name))) :*: ((S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [DType]) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe DKind))) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [DCon]) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [DDerivClause]))))) :+: (C1 (MetaCons "DTySynInstD" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DTySynEqn)) :+: C1 (MetaCons "DRoleAnnotD" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Role])))) :+: ((C1 (MetaCons "DStandaloneDerivD" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe DDerivStrategy)) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DCxt) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DType))) :+: C1 (MetaCons "DDefaultSigD" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DType))) :+: (C1 (MetaCons "DPatSynD" PrefixI False) ((S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 PatSynArgs)) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DPatSynDir) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DPat))) :+: C1 (MetaCons "DPatSynSigD" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DPatSynType))))))

data DDerivClause Source #

Corresponds to TH's `DerivClause` type.

Constructors

DDerivClause (Maybe DDerivStrategy) DCxt |

Instances

Data DDerivClause Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DDerivClause -> c DDerivClause Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DDerivClause Source #

toConstr :: DDerivClause -> Constr Source #

dataTypeOf :: DDerivClause -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DDerivClause) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DDerivClause) Source #

gmapT :: (forall b. Data b => b -> b) -> DDerivClause -> DDerivClause Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DDerivClause -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DDerivClause -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> DDerivClause -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DDerivClause -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DDerivClause -> m DDerivClause Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DDerivClause -> m DDerivClause Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DDerivClause -> m DDerivClause Source #

Show DDerivClause Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Methods showsPrec :: Int -> DDerivClause -> ShowS Source # show :: DDerivClause -> String Source # showList :: [DDerivClause] -> ShowS Source #
Generic DDerivClause Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Associated Types type Rep DDerivClause :: Type -> Type Source # Methods from :: DDerivClause -> Rep DDerivClause x Source # to :: Rep DDerivClause x -> DDerivClause Source #
Lift DDerivClause Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Lift Methods lift :: DDerivClause -> Q Exp Source #
type Rep DDerivClause Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

type Rep DDerivClause = D1 (MetaData "DDerivClause" "Language.Haskell.TH.Desugar.AST" "th-desugar-1.9-5oEkqzRynNEJ8Qz3c6iqXN" False) (C1 (MetaCons "DDerivClause" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe DDerivStrategy)) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DCxt)))

data DDerivStrategy Source #

Corresponds to TH's `DerivStrategy` type.

Constructors

DStockStrategy | A "standard" derived instance

DAnyclassStrategy

    -XDeriveAnyClass

DNewtypeStrategy

    -XGeneralizedNewtypeDeriving

DViaStrategy DType

    -XDerivingVia

Instances

Data DDerivStrategy Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DDerivStrategy -> c DDerivStrategy Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DDerivStrategy Source #

toConstr :: DDerivStrategy -> Constr Source #

dataTypeOf :: DDerivStrategy -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DDerivStrategy) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DDerivStrategy) Source #

gmapT :: (forall b. Data b => b -> b) -> DDerivStrategy -> DDerivStrategy Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DDerivStrategy -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DDerivStrategy -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> DDerivStrategy -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DDerivStrategy -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DDerivStrategy -> m DDerivStrategy Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DDerivStrategy -> m DDerivStrategy Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DDerivStrategy -> m DDerivStrategy Source #

Show DDerivStrategy Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Methods showsPrec :: Int -> DDerivStrategy -> ShowS Source # show :: DDerivStrategy -> String Source # showList :: [DDerivStrategy] -> ShowS Source #
Generic DDerivStrategy Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Associated Types type Rep DDerivStrategy :: Type -> Type Source # Methods from :: DDerivStrategy -> Rep DDerivStrategy x Source # to :: Rep DDerivStrategy x -> DDerivStrategy Source #
Lift DDerivStrategy Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Lift Methods lift :: DDerivStrategy -> Q Exp Source #
type Rep DDerivStrategy Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

type Rep DDerivStrategy = D1 (MetaData "DDerivStrategy" "Language.Haskell.TH.Desugar.AST" "th-desugar-1.9-5oEkqzRynNEJ8Qz3c6iqXN" False) ((C1 (MetaCons "DStockStrategy" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "DAnyclassStrategy" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "DNewtypeStrategy" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "DViaStrategy" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DType))))

data DPatSynDir Source #

Corresponds to TH's `PatSynDir` type

Constructors

DUnidir

    pattern P x {<-} p

DImplBidir

    pattern P x {=} p

DExplBidir [DClause]

    pattern P x {<-} p where P x = e

Instances

Data DPatSynDir Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DPatSynDir -> c DPatSynDir Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DPatSynDir Source #

toConstr :: DPatSynDir -> Constr Source #

dataTypeOf :: DPatSynDir -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DPatSynDir) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DPatSynDir) Source #

gmapT :: (forall b. Data b => b -> b) -> DPatSynDir -> DPatSynDir Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DPatSynDir -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DPatSynDir -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> DPatSynDir -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DPatSynDir -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DPatSynDir -> m DPatSynDir Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DPatSynDir -> m DPatSynDir Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DPatSynDir -> m DPatSynDir Source #

Show DPatSynDir Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Methods showsPrec :: Int -> DPatSynDir -> ShowS Source # show :: DPatSynDir -> String Source # showList :: [DPatSynDir] -> ShowS Source #
Generic DPatSynDir Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Associated Types type Rep DPatSynDir :: Type -> Type Source # Methods from :: DPatSynDir -> Rep DPatSynDir x Source # to :: Rep DPatSynDir x -> DPatSynDir Source #
Lift DPatSynDir Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Lift Methods lift :: DPatSynDir -> Q Exp Source #
type Rep DPatSynDir Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

type Rep DPatSynDir = D1 (MetaData "DPatSynDir" "Language.Haskell.TH.Desugar.AST" "th-desugar-1.9-5oEkqzRynNEJ8Qz3c6iqXN" False) (C1 (MetaCons "DUnidir" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "DImplBidir" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "DExplBidir" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [DClause]))))

type DPatSynType = DType Source #

Corresponds to TH's `PatSynType` type

data Overlap Source #

Varieties of allowed instance overlap.

Constructors

Overlappable | May be overlapped by more specific instances
Overlapping | May overlap a more general instance
Overlaps | Both `Overlapping` and `Overlappable`
Incoherent | Both `Overlappable` and `Overlappable`, and pick an arbitrary one if multiple choices are available.

Instances

Eq Overlap |
Instance details Defined in Language.Haskell.TH.Syntax Methods (==) :: Overlap -> Overlap -> Bool Source # (/=) :: Overlap -> Overlap -> Bool Source #
Data Overlap |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Overlap -> c Overlap Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Overlap Source #

toConstr :: Overlap -> Constr Source #

dataTypeOf :: Overlap -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Overlap) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Overlap) Source #

gmapT :: (forall b. Data b => b -> b) -> Overlap -> Overlap Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Overlap -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Overlap -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Overlap -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Overlap -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Overlap -> m Overlap Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Overlap -> m Overlap Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Overlap -> m Overlap Source #

Ord Overlap |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: Overlap -> Overlap -> Ordering Source # (<) :: Overlap -> Overlap -> Bool Source # (<=) :: Overlap -> Overlap -> Bool Source # (>) :: Overlap -> Overlap -> Bool Source # (>=) :: Overlap -> Overlap -> Bool Source # max :: Overlap -> Overlap -> Overlap Source # min :: Overlap -> Overlap -> Overlap Source #
Show Overlap |
Instance details Defined in Language.Haskell.TH.Syntax Methods showsPrec :: Int -> Overlap -> ShowS Source # show :: Overlap -> String Source # showList :: [Overlap] -> ShowS Source #
Generic Overlap |
Instance details Defined in Language.Haskell.TH.Syntax Associated Types type Rep Overlap :: Type -> Type Source # Methods from :: Overlap -> Rep Overlap x Source # to :: Rep Overlap x -> Overlap Source #
type Rep Overlap |

Instance details

Defined in Language.Haskell.TH.Syntax

type Rep Overlap = D1 (MetaData "Overlap" "Language.Haskell.TH.Syntax" "template-haskell" False) ((C1 (MetaCons "Overlappable" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Overlapping" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "Overlaps" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Incoherent" PrefixI False) (U1 :: Type -> Type)))

data PatSynArgs Source #

A pattern synonym's argument type.

Constructors

PrefixPatSyn [Name]

    pattern P {x y z} = p

InfixPatSyn Name Name

    pattern {x P y} = p

RecordPatSyn [Name]

    pattern P { {x,y,z} } = p

Instances

Eq PatSynArgs |
Instance details Defined in Language.Haskell.TH.Syntax Methods (==) :: PatSynArgs -> PatSynArgs -> Bool Source # (/=) :: PatSynArgs -> PatSynArgs -> Bool Source #
Data PatSynArgs |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PatSynArgs -> c PatSynArgs Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PatSynArgs Source #

toConstr :: PatSynArgs -> Constr Source #

dataTypeOf :: PatSynArgs -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c PatSynArgs) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PatSynArgs) Source #

gmapT :: (forall b. Data b => b -> b) -> PatSynArgs -> PatSynArgs Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PatSynArgs -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PatSynArgs -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> PatSynArgs -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> PatSynArgs -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> PatSynArgs -> m PatSynArgs Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PatSynArgs -> m PatSynArgs Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PatSynArgs -> m PatSynArgs Source #

Ord PatSynArgs |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

compare :: PatSynArgs -> PatSynArgs -> Ordering Source #

(<) :: PatSynArgs -> PatSynArgs -> Bool Source #

(<=) :: PatSynArgs -> PatSynArgs -> Bool Source #

(>) :: PatSynArgs -> PatSynArgs -> Bool Source #

(>=) :: PatSynArgs -> PatSynArgs -> Bool Source #

max :: PatSynArgs -> PatSynArgs -> PatSynArgs Source #

min :: PatSynArgs -> PatSynArgs -> PatSynArgs Source #

Show PatSynArgs |
Instance details Defined in Language.Haskell.TH.Syntax Methods showsPrec :: Int -> PatSynArgs -> ShowS Source # show :: PatSynArgs -> String Source # showList :: [PatSynArgs] -> ShowS Source #
Generic PatSynArgs |
Instance details Defined in Language.Haskell.TH.Syntax Associated Types type Rep PatSynArgs :: Type -> Type Source # Methods from :: PatSynArgs -> Rep PatSynArgs x Source # to :: Rep PatSynArgs x -> PatSynArgs Source #
Ppr PatSynArgs |
Instance details Defined in Language.Haskell.TH.Ppr Methods ppr :: PatSynArgs -> Doc Source # ppr_list :: [PatSynArgs] -> Doc Source #
type Rep PatSynArgs |

Instance details

Defined in Language.Haskell.TH.Syntax

type Rep PatSynArgs = D1 (MetaData "PatSynArgs" "Language.Haskell.TH.Syntax" "template-haskell" False) (C1 (MetaCons "PrefixPatSyn" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Name])) :+: (C1 (MetaCons "InfixPatSyn" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name)) :+: C1 (MetaCons "RecordPatSyn" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Name]))))

data NewOrData Source #

Is it a `newtype` or a `data` type?

Constructors

Newtype |
Data |

Instances

Eq NewOrData Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Methods (==) :: NewOrData -> NewOrData -> Bool Source # (/=) :: NewOrData -> NewOrData -> Bool Source #
Data NewOrData Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NewOrData -> c NewOrData Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c NewOrData Source #

toConstr :: NewOrData -> Constr Source #

dataTypeOf :: NewOrData -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c NewOrData) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NewOrData) Source #

gmapT :: (forall b. Data b => b -> b) -> NewOrData -> NewOrData Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NewOrData -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NewOrData -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> NewOrData -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> NewOrData -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> NewOrData -> m NewOrData Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NewOrData -> m NewOrData Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NewOrData -> m NewOrData Source #

Show NewOrData Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Methods showsPrec :: Int -> NewOrData -> ShowS Source # show :: NewOrData -> String Source # showList :: [NewOrData] -> ShowS Source #
Generic NewOrData Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Associated Types type Rep NewOrData :: Type -> Type Source # Methods from :: NewOrData -> Rep NewOrData x Source # to :: Rep NewOrData x -> NewOrData Source #
Lift NewOrData Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Lift Methods lift :: NewOrData -> Q Exp Source #
type Rep NewOrData Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST type Rep NewOrData = D1 (MetaData "NewOrData" "Language.Haskell.TH.Desugar.AST" "th-desugar-1.9-5oEkqzRynNEJ8Qz3c6iqXN" False) (C1 (MetaCons "Newtype" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Data" PrefixI False) (U1 :: Type -> Type))

data DTypeFamilyHead Source #

Corresponds to TH's `TypeFamilyHead` type

Constructors

DTypeFamilyHead Name [DTyVarBndr] DFamilyResultSig (Maybe InjectivityAnn) |

Instances

Data DTypeFamilyHead Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DTypeFamilyHead -> c DTypeFamilyHead Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DTypeFamilyHead Source #

toConstr :: DTypeFamilyHead -> Constr Source #

dataTypeOf :: DTypeFamilyHead -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DTypeFamilyHead) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DTypeFamilyHead) Source #

gmapT :: (forall b. Data b => b -> b) -> DTypeFamilyHead -> DTypeFamilyHead Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DTypeFamilyHead -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DTypeFamilyHead -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> DTypeFamilyHead -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DTypeFamilyHead -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DTypeFamilyHead -> m DTypeFamilyHead Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DTypeFamilyHead -> m DTypeFamilyHead Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DTypeFamilyHead -> m DTypeFamilyHead Source #

Show DTypeFamilyHead Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Methods showsPrec :: Int -> DTypeFamilyHead -> ShowS Source # show :: DTypeFamilyHead -> String Source # showList :: [DTypeFamilyHead] -> ShowS Source #
Generic DTypeFamilyHead Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Associated Types type Rep DTypeFamilyHead :: Type -> Type Source # Methods from :: DTypeFamilyHead -> Rep DTypeFamilyHead x Source # to :: Rep DTypeFamilyHead x -> DTypeFamilyHead Source #
Lift DTypeFamilyHead Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Lift Methods lift :: DTypeFamilyHead -> Q Exp Source #
type Rep DTypeFamilyHead Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

type Rep DTypeFamilyHead = D1 (MetaData "DTypeFamilyHead" "Language.Haskell.TH.Desugar.AST" "th-desugar-1.9-5oEkqzRynNEJ8Qz3c6iqXN" False) (C1 (MetaCons "DTypeFamilyHead" PrefixI False) ((S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [DTyVarBndr])) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DFamilyResultSig) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe InjectivityAnn)))))

data DFamilyResultSig Source #

Corresponds to TH's `FamilyResultSig` type

Constructors

DNoSig |
DKindSig DKind |
DTyVarSig DTyVarBndr |

Instances

Data DFamilyResultSig Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DFamilyResultSig -> c DFamilyResultSig Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DFamilyResultSig Source #

toConstr :: DFamilyResultSig -> Constr Source #

dataTypeOf :: DFamilyResultSig -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DFamilyResultSig) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DFamilyResultSig) Source #

gmapT :: (forall b. Data b => b -> b) -> DFamilyResultSig -> DFamilyResultSig Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DFamilyResultSig -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DFamilyResultSig -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> DFamilyResultSig -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DFamilyResultSig -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DFamilyResultSig -> m DFamilyResultSig Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DFamilyResultSig -> m DFamilyResultSig Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DFamilyResultSig -> m DFamilyResultSig Source #

Show DFamilyResultSig Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Methods showsPrec :: Int -> DFamilyResultSig -> ShowS Source # show :: DFamilyResultSig -> String Source # showList :: [DFamilyResultSig] -> ShowS Source #
Generic DFamilyResultSig Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Associated Types type Rep DFamilyResultSig :: Type -> Type Source # Methods from :: DFamilyResultSig -> Rep DFamilyResultSig x Source # to :: Rep DFamilyResultSig x -> DFamilyResultSig Source #
Lift DFamilyResultSig Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Lift Methods lift :: DFamilyResultSig -> Q Exp Source #
type Rep DFamilyResultSig Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

type Rep DFamilyResultSig = D1 (MetaData "DFamilyResultSig" "Language.Haskell.TH.Desugar.AST" "th-desugar-1.9-5oEkqzRynNEJ8Qz3c6iqXN" False) (C1 (MetaCons "DNoSig" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "DKindSig" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DKind)) :+: C1 (MetaCons "DTyVarSig" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DTyVarBndr))))

data InjectivityAnn Source #

Injectivity annotation

Constructors

InjectivityAnn Name [Name] |

Instances

Eq InjectivityAnn |
Instance details Defined in Language.Haskell.TH.Syntax Methods (==) :: InjectivityAnn -> InjectivityAnn -> Bool Source # (/=) :: InjectivityAnn -> InjectivityAnn -> Bool Source #
Data InjectivityAnn |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> InjectivityAnn -> c InjectivityAnn Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c InjectivityAnn Source #

toConstr :: InjectivityAnn -> Constr Source #

dataTypeOf :: InjectivityAnn -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c InjectivityAnn) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c InjectivityAnn) Source #

gmapT :: (forall b. Data b => b -> b) -> InjectivityAnn -> InjectivityAnn Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> InjectivityAnn -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> InjectivityAnn -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> InjectivityAnn -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> InjectivityAnn -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> InjectivityAnn -> m InjectivityAnn Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> InjectivityAnn -> m InjectivityAnn Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> InjectivityAnn -> m InjectivityAnn Source #

Ord InjectivityAnn |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

compare :: InjectivityAnn -> InjectivityAnn -> Ordering Source #

(<) :: InjectivityAnn -> InjectivityAnn -> Bool Source #

(<=) :: InjectivityAnn -> InjectivityAnn -> Bool Source #

(>) :: InjectivityAnn -> InjectivityAnn -> Bool Source #

(>=) :: InjectivityAnn -> InjectivityAnn -> Bool Source #

max :: InjectivityAnn -> InjectivityAnn -> InjectivityAnn Source #

min :: InjectivityAnn -> InjectivityAnn -> InjectivityAnn Source #

Show InjectivityAnn |
Instance details Defined in Language.Haskell.TH.Syntax Methods showsPrec :: Int -> InjectivityAnn -> ShowS Source # show :: InjectivityAnn -> String Source # showList :: [InjectivityAnn] -> ShowS Source #
Generic InjectivityAnn |
Instance details Defined in Language.Haskell.TH.Syntax Associated Types type Rep InjectivityAnn :: Type -> Type Source # Methods from :: InjectivityAnn -> Rep InjectivityAnn x Source # to :: Rep InjectivityAnn x -> InjectivityAnn Source #
Ppr InjectivityAnn |
Instance details Defined in Language.Haskell.TH.Ppr Methods ppr :: InjectivityAnn -> Doc Source # ppr_list :: [InjectivityAnn] -> Doc Source #
type Rep InjectivityAnn |

Instance details

Defined in Language.Haskell.TH.Syntax

type Rep InjectivityAnn = D1 (MetaData "InjectivityAnn" "Language.Haskell.TH.Syntax" "template-haskell" False) (C1 (MetaCons "InjectivityAnn" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Name])))

data DCon Source #

Corresponds to TH's `Con` type. Unlike `Con`, all `DCon`s reflect GADT syntax. This is beneficial for `th-desugar`'s since it means that all data type declarations can support explicit return kinds, so one does not need to represent them with something like ``Maybe` `DKind``, since Haskell98-style data declaration syntax isn't used. Accordingly, there are some differences between `DCon` and `Con` to keep in mind:

- Unlike `ForallC`, where the meaning of the `TyVarBndr`s changes depending on whether it's followed by 'GadtC'/'RecGadtC' or not, the meaning of the `DTyVarBndr`s in a `DCon` is always the same: it is the list of universally and existentially quantified type variables. Note that it is not guaranteed that one set of type variables will appear before the other.
- A `DCon` always has an explicit return type.

Constructors

DCon [DTyVarBndr] DCxt Name DConFields DType | The GADT result type

Instances

Data DCon Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DCon -> c DCon Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DCon Source #

toConstr :: DCon -> Constr Source #

dataTypeOf :: DCon -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DCon) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DCon) Source #

gmapT :: (forall b. Data b => b -> b) -> DCon -> DCon Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DCon -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DCon -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> DCon -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DCon -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DCon -> m DCon Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DCon -> m DCon Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DCon -> m DCon Source #

Show DCon Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Methods showsPrec :: Int -> DCon -> ShowS Source # show :: DCon -> String Source # showList :: [DCon] -> ShowS Source #
Generic DCon Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Associated Types type Rep DCon :: Type -> Type Source # Methods from :: DCon -> Rep DCon x Source # to :: Rep DCon x -> DCon Source #
Lift DCon Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Lift Methods lift :: DCon -> Q Exp Source #
type Rep DCon Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

type Rep DCon = D1 (MetaData "DCon" "Language.Haskell.TH.Desugar.AST" "th-desugar-1.9-5oEkqzRynNEJ8Qz3c6iqXN" False) (C1 (MetaCons "DCon" PrefixI False) ((S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [DTyVarBndr]) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DCxt)) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DConFields) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DType)))))

data DConFields Source #

A list of fields either for a standard data constructor or a record data constructor.

Constructors

DNormalC DDeclaredInfix [DBangType] |
DRecC [DVarBangType] |

Instances

Data DConFields Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DConFields -> c DConFields Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DConFields Source #

toConstr :: DConFields -> Constr Source #

dataTypeOf :: DConFields -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DConFields) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DConFields) Source #

gmapT :: (forall b. Data b => b -> b) -> DConFields -> DConFields Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DConFields -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DConFields -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> DConFields -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DConFields -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DConFields -> m DConFields Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DConFields -> m DConFields Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DConFields -> m DConFields Source #

Show DConFields Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Methods showsPrec :: Int -> DConFields -> ShowS Source # show :: DConFields -> String Source # showList :: [DConFields] -> ShowS Source #
Generic DConFields Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Associated Types type Rep DConFields :: Type -> Type Source # Methods from :: DConFields -> Rep DConFields x Source # to :: Rep DConFields x -> DConFields Source #
Lift DConFields Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Lift Methods lift :: DConFields -> Q Exp Source #
type Rep DConFields Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

type Rep DConFields = D1 (MetaData "DConFields" "Language.Haskell.TH.Desugar.AST" "th-desugar-1.9-5oEkqzRynNEJ8Qz3c6iqXN" False) (C1 (MetaCons "DNormalC" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DDeclaredInfix) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [DBangType])) :+: C1 (MetaCons "DRecC" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [DVarBangType])))

type DDeclaredInfix = Bool Source #

`True` if a constructor is declared infix. For normal ADTs, this means that is was written in infix style. For example, both of the constructors below are declared infix.

    data Infix = Int Fixity Int | Int :*: Int

Whereas neither of these constructors are declared infix:

    data Prefix = Prefix Int Int | (:+:) Int Int

For GADTs, detecting whether a constructor is declared infix is a bit trickier, as one cannot write a GADT constructor "infix-style" like one can for normal ADT constructors. GHC considers a GADT constructor to be declared infix if it meets the following three criteria:

1. Its name uses operator syntax (e.g., `(:*:)`).
2. It has exactly two fields (without record syntax).
3. It has a programmer-specified fixity declaration.

For example, in the following GADT:

    infixl 5 :**:, :&&:, :^^:, ActuallyPrefix
    data InfixGADT a where
      (:**:) :: Int -> b -> InfixGADT (Maybe b) -- Only this one is infix
      ActuallyPrefix :: Char -> Bool -> InfixGADT Double
      (:&&:) :: { infixGADT1 :: b, infixGADT2 :: Int } -> InfixGADT b :: Int -> Int -> Int -> InfixGADT Int
      (:!!:) :: Char -> Char -> InfixGADT Char

Only the `(:**:)` constructor is declared infix. The other constructors are not declared infix, because:

- `ActuallyPrefix` does not use operator syntax (criterion 1).
- `(:&&:)` uses record syntax (criterion 2).
- `(:^^:)` does not have exactly two fields (criterion 2).
- `(:!!:)` does not have a programmer-specified fixity declaration (criterion 3).

type DBangType = (Bang, DType) Source #

Corresponds to TH's `BangType` type.

type DVarBangType = (Name, Bang, DType) Source #

Corresponds to TH's `VarBangType` type.

data Bang Source #

Constructors

Bang SourceUnpackedness SourceStrictness

    C { {-# UNPACK #-} !}a

Instances

Eq Bang |
Instance details Defined in Language.Haskell.TH.Syntax Methods (==) :: Bang -> Bang -> Bool Source # (/=) :: Bang -> Bang -> Bool Source #
Data Bang |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Bang -> c Bang Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Bang Source #

toConstr :: Bang -> Constr Source #

dataTypeOf :: Bang -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Bang) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Bang) Source #

gmapT :: (forall b. Data b => b -> b) -> Bang -> Bang Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Bang -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Bang -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Bang -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Bang -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Bang -> m Bang Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Bang -> m Bang Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Bang -> m Bang Source #

Ord Bang |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: Bang -> Bang -> Ordering Source # (<) :: Bang -> Bang -> Bool Source # (<=) :: Bang -> Bang -> Bool Source # (>) :: Bang -> Bang -> Bool Source # (>=) :: Bang -> Bang -> Bool Source # max :: Bang -> Bang -> Bang Source # min :: Bang -> Bang -> Bang Source #
Show Bang |
Instance details Defined in Language.Haskell.TH.Syntax Methods showsPrec :: Int -> Bang -> ShowS Source # show :: Bang -> String Source # showList :: [Bang] -> ShowS Source #
Generic Bang |
Instance details Defined in Language.Haskell.TH.Syntax Associated Types type Rep Bang :: Type -> Type Source # Methods from :: Bang -> Rep Bang x Source # to :: Rep Bang x -> Bang Source #
Ppr Bang |
Instance details Defined in Language.Haskell.TH.Ppr Methods ppr :: Bang -> Doc Source # ppr_list :: [Bang] -> Doc Source #
type Rep Bang |

Instance details

Defined in Language.Haskell.TH.Syntax

type Rep Bang = D1 (MetaData "Bang" "Language.Haskell.TH.Syntax" "template-haskell" False) (C1 (MetaCons "Bang" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 SourceUnpackedness) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 SourceStrictness)))

data SourceUnpackedness Source #

Constructors

NoSourceUnpackedness

    C a

SourceNoUnpack

    C { {-# NOUNPACK #-} } a

SourceUnpack

    C { {-# UNPACK #-} } a

Instances

Eq SourceUnpackedness |
Instance details Defined in Language.Haskell.TH.Syntax Methods (==) :: SourceUnpackedness -> SourceUnpackedness -> Bool Source # (/=) :: SourceUnpackedness -> SourceUnpackedness -> Bool Source #
Data SourceUnpackedness |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SourceUnpackedness -> c SourceUnpackedness Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SourceUnpackedness Source #

toConstr :: SourceUnpackedness -> Constr Source #

dataTypeOf :: SourceUnpackedness -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SourceUnpackedness) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SourceUnpackedness) Source #

gmapT :: (forall b. Data b => b -> b) -> SourceUnpackedness -> SourceUnpackedness Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SourceUnpackedness -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SourceUnpackedness -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> SourceUnpackedness -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SourceUnpackedness -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SourceUnpackedness -> m SourceUnpackedness Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SourceUnpackedness -> m SourceUnpackedness Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SourceUnpackedness -> m SourceUnpackedness Source #

Ord SourceUnpackedness |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

compare :: SourceUnpackedness -> SourceUnpackedness -> Ordering Source #

(<) :: SourceUnpackedness -> SourceUnpackedness -> Bool Source #

(<=) :: SourceUnpackedness -> SourceUnpackedness -> Bool Source #

(>) :: SourceUnpackedness -> SourceUnpackedness -> Bool Source #

(>=) :: SourceUnpackedness -> SourceUnpackedness -> Bool Source #

max :: SourceUnpackedness -> SourceUnpackedness -> SourceUnpackedness Source #

min :: SourceUnpackedness -> SourceUnpackedness -> SourceUnpackedness Source #

Show SourceUnpackedness |
Instance details Defined in Language.Haskell.TH.Syntax Methods showsPrec :: Int -> SourceUnpackedness -> ShowS Source # show :: SourceUnpackedness -> String Source # showList :: [SourceUnpackedness] -> ShowS Source #
Generic SourceUnpackedness |
Instance details Defined in Language.Haskell.TH.Syntax Associated Types type Rep SourceUnpackedness :: Type -> Type Source # Methods from :: SourceUnpackedness -> Rep SourceUnpackedness x Source # to :: Rep SourceUnpackedness x -> SourceUnpackedness Source #
Ppr SourceUnpackedness |
Instance details Defined in Language.Haskell.TH.Ppr Methods ppr :: SourceUnpackedness -> Doc Source # ppr_list :: [SourceUnpackedness] -> Doc Source #
type Rep SourceUnpackedness |
Instance details Defined in Language.Haskell.TH.Syntax type Rep SourceUnpackedness = D1 (MetaData "SourceUnpackedness" "Language.Haskell.TH.Syntax" "template-haskell" False) (C1 (MetaCons "NoSourceUnpackedness" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "SourceNoUnpack" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "SourceUnpack" PrefixI False) (U1 :: Type -> Type)))

data SourceStrictness Source #

Constructors

NoSourceStrictness

    C a

SourceLazy

    C {~}a

SourceStrict

    C {!}a

Instances

Eq SourceStrictness |
Instance details Defined in Language.Haskell.TH.Syntax Methods (==) :: SourceStrictness -> SourceStrictness -> Bool Source # (/=) :: SourceStrictness -> SourceStrictness -> Bool Source #
Data SourceStrictness |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SourceStrictness -> c SourceStrictness Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SourceStrictness Source #

toConstr :: SourceStrictness -> Constr Source #

dataTypeOf :: SourceStrictness -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SourceStrictness) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SourceStrictness) Source #

gmapT :: (forall b. Data b => b -> b) -> SourceStrictness -> SourceStrictness Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SourceStrictness -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SourceStrictness -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> SourceStrictness -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SourceStrictness -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SourceStrictness -> m SourceStrictness Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SourceStrictness -> m SourceStrictness Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SourceStrictness -> m SourceStrictness Source #

Ord SourceStrictness |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

compare :: SourceStrictness -> SourceStrictness -> Ordering Source #

(<) :: SourceStrictness -> SourceStrictness -> Bool Source #

(<=) :: SourceStrictness -> SourceStrictness -> Bool Source #

(>) :: SourceStrictness -> SourceStrictness -> Bool Source #

(>=) :: SourceStrictness -> SourceStrictness -> Bool Source #

max :: SourceStrictness -> SourceStrictness -> SourceStrictness Source #

min :: SourceStrictness -> SourceStrictness -> SourceStrictness Source #

Show SourceStrictness |
Instance details Defined in Language.Haskell.TH.Syntax Methods showsPrec :: Int -> SourceStrictness -> ShowS Source # show :: SourceStrictness -> String Source # showList :: [SourceStrictness] -> ShowS Source #
Generic SourceStrictness |
Instance details Defined in Language.Haskell.TH.Syntax Associated Types type Rep SourceStrictness :: Type -> Type Source # Methods from :: SourceStrictness -> Rep SourceStrictness x Source # to :: Rep SourceStrictness x -> SourceStrictness Source #
Ppr SourceStrictness |
Instance details Defined in Language.Haskell.TH.Ppr Methods ppr :: SourceStrictness -> Doc Source # ppr_list :: [SourceStrictness] -> Doc Source #
type Rep SourceStrictness |
Instance details Defined in Language.Haskell.TH.Syntax type Rep SourceStrictness = D1 (MetaData "SourceStrictness" "Language.Haskell.TH.Syntax" "template-haskell" False) (C1 (MetaCons "NoSourceStrictness" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "SourceLazy" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "SourceStrict" PrefixI False) (U1 :: Type -> Type)))

data DForeign Source #

Corresponds to TH's `Foreign` type.

Constructors

DImportF Callconv Safety String Name DType |
DExportF Callconv String Name DType |

Instances

Data DForeign Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DForeign -> c DForeign Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DForeign Source #

toConstr :: DForeign -> Constr Source #

dataTypeOf :: DForeign -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DForeign) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DForeign) Source #

gmapT :: (forall b. Data b => b -> b) -> DForeign -> DForeign Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DForeign -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DForeign -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> DForeign -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DForeign -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DForeign -> m DForeign Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DForeign -> m DForeign Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DForeign -> m DForeign Source #

Show DForeign Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Methods showsPrec :: Int -> DForeign -> ShowS Source # show :: DForeign -> String Source # showList :: [DForeign] -> ShowS Source #
Generic DForeign Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Associated Types type Rep DForeign :: Type -> Type Source # Methods from :: DForeign -> Rep DForeign x Source # to :: Rep DForeign x -> DForeign Source #
Lift DForeign Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Lift Methods lift :: DForeign -> Q Exp Source #
type Rep DForeign Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

type Rep DForeign = D1 (MetaData "DForeign" "Language.Haskell.TH.Desugar.AST" "th-desugar-1.9-5oEkqzRynNEJ8Qz3c6iqXN" False) (C1 (MetaCons "DImportF" PrefixI False) ((S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Callconv) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Safety)) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DType)))) :+: C1 (MetaCons "DExportF" PrefixI False) ((S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Callconv) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String)) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DType))))

data DPragma Source #

Corresponds to TH's `Pragma` type.

Constructors

DInlineP Name Inline RuleMatch Phases |
DSpecialiseP Name DType (Maybe Inline) Phases |
DSpecialiseInstP DType |
DRuleP String [DRuleBndr] DExp DExp Phases |
DAnnP AnnTarget DExp |
DLineP Int String |
DCompleteP [Name] (Maybe Name) |

Instances

Data DPragma Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DPragma -> c DPragma Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DPragma Source #

toConstr :: DPragma -> Constr Source #

dataTypeOf :: DPragma -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DPragma) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DPragma) Source #

gmapT :: (forall b. Data b => b -> b) -> DPragma -> DPragma Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DPragma -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DPragma -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> DPragma -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DPragma -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DPragma -> m DPragma Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DPragma -> m DPragma Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DPragma -> m DPragma Source #

Show DPragma Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Methods showsPrec :: Int -> DPragma -> ShowS Source # show :: DPragma -> String Source # showList :: [DPragma] -> ShowS Source #
Generic DPragma Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Associated Types type Rep DPragma :: Type -> Type Source # Methods from :: DPragma -> Rep DPragma x Source # to :: Rep DPragma x -> DPragma Source #
Lift DPragma Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Lift Methods lift :: DPragma -> Q Exp Source #
type Rep DPragma Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

type Rep DPragma = D1 (MetaData "DPragma" "Language.Haskell.TH.Desugar.AST" "th-desugar-1.9-5oEkqzRynNEJ8Qz3c6iqXN" False) ((C1 (MetaCons "DInlineP" PrefixI False) ((S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Inline)) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 RuleMatch) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Phases))) :+: (C1 (MetaCons "DSpecialiseP" PrefixI False) ((S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DType)) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Inline)) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Phases))) :+: C1 (MetaCons "DSpecialiseInstP" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DType)))) :+: ((C1 (MetaCons "DRuleP" PrefixI False) ((S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [DRuleBndr])) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DExp) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DExp) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Phases)))) :+: C1 (MetaCons "DAnnP" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 AnnTarget) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DExp))) :+: (C1 (MetaCons "DLineP" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String)) :+: C1 (MetaCons "DCompleteP" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Name]) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Name))))))

data DRuleBndr Source #

Corresponds to TH's `RuleBndr` type.

Constructors

DRuleVar Name |
DTypedRuleVar Name DType |

Instances

Data DRuleBndr Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DRuleBndr -> c DRuleBndr Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DRuleBndr Source #

toConstr :: DRuleBndr -> Constr Source #

dataTypeOf :: DRuleBndr -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DRuleBndr) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DRuleBndr) Source #

gmapT :: (forall b. Data b => b -> b) -> DRuleBndr -> DRuleBndr Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DRuleBndr -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DRuleBndr -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> DRuleBndr -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DRuleBndr -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DRuleBndr -> m DRuleBndr Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DRuleBndr -> m DRuleBndr Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DRuleBndr -> m DRuleBndr Source #

Show DRuleBndr Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Methods showsPrec :: Int -> DRuleBndr -> ShowS Source # show :: DRuleBndr -> String Source # showList :: [DRuleBndr] -> ShowS Source #
Generic DRuleBndr Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Associated Types type Rep DRuleBndr :: Type -> Type Source # Methods from :: DRuleBndr -> Rep DRuleBndr x Source # to :: Rep DRuleBndr x -> DRuleBndr Source #
Lift DRuleBndr Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Lift Methods lift :: DRuleBndr -> Q Exp Source #
type Rep DRuleBndr Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

type Rep DRuleBndr = D1 (MetaData "DRuleBndr" "Language.Haskell.TH.Desugar.AST" "th-desugar-1.9-5oEkqzRynNEJ8Qz3c6iqXN" False) (C1 (MetaCons "DRuleVar" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name)) :+: C1 (MetaCons "DTypedRuleVar" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DType)))

data DTySynEqn Source #

Corresponds to TH's `TySynEqn` type (to store type family equations).

Constructors

DTySynEqn [DType] DType |

Instances

Data DTySynEqn Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DTySynEqn -> c DTySynEqn Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DTySynEqn Source #

toConstr :: DTySynEqn -> Constr Source #

dataTypeOf :: DTySynEqn -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DTySynEqn) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DTySynEqn) Source #

gmapT :: (forall b. Data b => b -> b) -> DTySynEqn -> DTySynEqn Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DTySynEqn -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DTySynEqn -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> DTySynEqn -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DTySynEqn -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DTySynEqn -> m DTySynEqn Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DTySynEqn -> m DTySynEqn Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DTySynEqn -> m DTySynEqn Source #

Show DTySynEqn Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Methods showsPrec :: Int -> DTySynEqn -> ShowS Source # show :: DTySynEqn -> String Source # showList :: [DTySynEqn] -> ShowS Source #
Generic DTySynEqn Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Associated Types type Rep DTySynEqn :: Type -> Type Source # Methods from :: DTySynEqn -> Rep DTySynEqn x Source # to :: Rep DTySynEqn x -> DTySynEqn Source #
Lift DTySynEqn Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Lift Methods lift :: DTySynEqn -> Q Exp Source #
type Rep DTySynEqn Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

type Rep DTySynEqn = D1 (MetaData "DTySynEqn" "Language.Haskell.TH.Desugar.AST" "th-desugar-1.9-5oEkqzRynNEJ8Qz3c6iqXN" False) (C1 (MetaCons "DTySynEqn" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [DType]) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DType)))

data DInfo Source #

Corresponds to TH's `Info` type.

Constructors

DTyConI DDec (Maybe [DInstanceDec]) |
DVarI Name DType (Maybe Name) | The `Maybe Name` stores the name of the enclosing definition (datatype, for a data constructor; class, for a method), if any
DTyVarI Name DKind |
DPrimTyConI Name Int Bool | The `Int` is the arity; the `Bool` is whether this tycon is unlifted.
DPatSynI Name DPatSynType |

Instances

Data DInfo Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DInfo -> c DInfo Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DInfo Source #

toConstr :: DInfo -> Constr Source #

dataTypeOf :: DInfo -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DInfo) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DInfo) Source #

gmapT :: (forall b. Data b => b -> b) -> DInfo -> DInfo Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DInfo -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DInfo -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> DInfo -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DInfo -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DInfo -> m DInfo Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DInfo -> m DInfo Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DInfo -> m DInfo Source #

Show DInfo Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Methods showsPrec :: Int -> DInfo -> ShowS Source # show :: DInfo -> String Source # showList :: [DInfo] -> ShowS Source #
Generic DInfo Source # |
Instance details Defined in Language.Haskell.TH.Desugar.AST Associated Types type Rep DInfo :: Type -> Type Source # Methods from :: DInfo -> Rep DInfo x Source # to :: Rep DInfo x -> DInfo Source #
type Rep DInfo Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.AST

type Rep DInfo = D1 (MetaData "DInfo" "Language.Haskell.TH.Desugar.AST" "th-desugar-1.9-5oEkqzRynNEJ8Qz3c6iqXN" False) ((C1 (MetaCons "DTyConI" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DDec) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe [DInstanceDec]))) :+: C1 (MetaCons "DVarI" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DType) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Name))))) :+: (C1 (MetaCons "DTyVarI" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DKind)) :+: (C1 (MetaCons "DPrimTyConI" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool))) :+: C1 (MetaCons "DPatSynI" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DPatSynType)))))

type DInstanceDec Source #

Arguments

= DDec | Guaranteed to be an instance declaration

data Role Source #

Role annotations

Constructors

NominalR

    nominal

RepresentationalR

    representational

PhantomR

    phantom

InferR

    _

Instances

Eq Role |
Instance details Defined in Language.Haskell.TH.Syntax Methods (==) :: Role -> Role -> Bool Source # (/=) :: Role -> Role -> Bool Source #
Data Role |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Role -> c Role Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Role Source #

toConstr :: Role -> Constr Source #

dataTypeOf :: Role -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Role) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Role) Source #

gmapT :: (forall b. Data b => b -> b) -> Role -> Role Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Role -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Role -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Role -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Role -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Role -> m Role Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Role -> m Role Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Role -> m Role Source #

Ord Role |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: Role -> Role -> Ordering Source # (<) :: Role -> Role -> Bool Source # (<=) :: Role -> Role -> Bool Source # (>) :: Role -> Role -> Bool Source # (>=) :: Role -> Role -> Bool Source # max :: Role -> Role -> Role Source # min :: Role -> Role -> Role Source #
Show Role |
Instance details Defined in Language.Haskell.TH.Syntax Methods showsPrec :: Int -> Role -> ShowS Source # show :: Role -> String Source # showList :: [Role] -> ShowS Source #
Generic Role |
Instance details Defined in Language.Haskell.TH.Syntax Associated Types type Rep Role :: Type -> Type Source # Methods from :: Role -> Rep Role x Source # to :: Rep Role x -> Role Source #
Ppr Role |
Instance details Defined in Language.Haskell.TH.Ppr Methods ppr :: Role -> Doc Source # ppr_list :: [Role] -> Doc Source #
type Rep Role |

Instance details

Defined in Language.Haskell.TH.Syntax

type Rep Role = D1 (MetaData "Role" "Language.Haskell.TH.Syntax" "template-haskell" False) ((C1 (MetaCons "NominalR" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "RepresentationalR" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "PhantomR" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "InferR" PrefixI False) (U1 :: Type -> Type)))

data AnnTarget Source #

Constructors

ModuleAnnotation |
TypeAnnotation Name |
ValueAnnotation Name |

Instances

Eq AnnTarget |
Instance details Defined in Language.Haskell.TH.Syntax Methods (==) :: AnnTarget -> AnnTarget -> Bool Source # (/=) :: AnnTarget -> AnnTarget -> Bool Source #
Data AnnTarget |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> AnnTarget -> c AnnTarget Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c AnnTarget Source #

toConstr :: AnnTarget -> Constr Source #

dataTypeOf :: AnnTarget -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c AnnTarget) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c AnnTarget) Source #

gmapT :: (forall b. Data b => b -> b) -> AnnTarget -> AnnTarget Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> AnnTarget -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> AnnTarget -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> AnnTarget -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> AnnTarget -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> AnnTarget -> m AnnTarget Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> AnnTarget -> m AnnTarget Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> AnnTarget -> m AnnTarget Source #

Ord AnnTarget |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

compare :: AnnTarget -> AnnTarget -> Ordering Source #

(<) :: AnnTarget -> AnnTarget -> Bool Source #

(<=) :: AnnTarget -> AnnTarget -> Bool Source #

(>) :: AnnTarget -> AnnTarget -> Bool Source #

(>=) :: AnnTarget -> AnnTarget -> Bool Source #

max :: AnnTarget -> AnnTarget -> AnnTarget Source #

min :: AnnTarget -> AnnTarget -> AnnTarget Source #

Show AnnTarget |
Instance details Defined in Language.Haskell.TH.Syntax Methods showsPrec :: Int -> AnnTarget -> ShowS Source # show :: AnnTarget -> String Source # showList :: [AnnTarget] -> ShowS Source #
Generic AnnTarget |
Instance details Defined in Language.Haskell.TH.Syntax Associated Types type Rep AnnTarget :: Type -> Type Source # Methods from :: AnnTarget -> Rep AnnTarget x Source # to :: Rep AnnTarget x -> AnnTarget Source #
type Rep AnnTarget |

Instance details

Defined in Language.Haskell.TH.Syntax

type Rep AnnTarget = D1 (MetaData "AnnTarget" "Language.Haskell.TH.Syntax" "template-haskell" False) (C1 (MetaCons "ModuleAnnotation" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "TypeAnnotation" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name)) :+: C1 (MetaCons "ValueAnnotation" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name))))

# The `Desugar` class

class Desugar th ds | ds -> th where Source #

This class relates a TH type with its th-desugar type and allows conversions back and forth. The functional dependency goes only one way because `Type` and `Kind` are type synonyms, but they desugar to different types.

Methods

desugar :: DsMonad q => th -> q ds Source #

sweeten :: ds -> th Source #

Instances

Desugar Exp DExp Source # |
Instance details Defined in Language.Haskell.TH.Desugar Methods desugar :: DsMonad q => Exp -> q DExp Source # sweeten :: DExp -> Exp Source #
Desugar Type DType Source # |
Instance details Defined in Language.Haskell.TH.Desugar Methods desugar :: DsMonad q => Type -> q DType Source # sweeten :: DType -> Type Source #
Desugar Cxt DCxt Source # |
Instance details Defined in Language.Haskell.TH.Desugar Methods desugar :: DsMonad q => Cxt -> q DCxt Source # sweeten :: DCxt -> Cxt Source #
Desugar TyVarBndr DTyVarBndr Source # |
Instance details Defined in Language.Haskell.TH.Desugar Methods desugar :: DsMonad q => TyVarBndr -> q DTyVarBndr Source # sweeten :: DTyVarBndr -> TyVarBndr Source #
Desugar [Dec] [DDec] Source # |
Instance details Defined in Language.Haskell.TH.Desugar Methods desugar :: DsMonad q => [Dec] -> q [DDec] Source # sweeten :: [DDec] -> [Dec] Source #

# Main desugaring functions

dsExp :: DsMonad q => Exp -> q DExp Source #

Desugar an expression

dsDecs :: DsMonad q => [Dec] -> q [DDec] Source #

Desugar arbitrary `Dec`s

dsType :: DsMonad q => Type -> q DType Source #

Desugar a type

dsInfo :: DsMonad q => Info -> q DInfo Source #

Desugar `Info`

dsPatOverExp :: DsMonad q => Pat -> DExp -> q (DPat, DExp) Source #

Desugar a pattern, along with processing a (desugared) expression that is the entire scope of the variables bound in the pattern.

dsPatsOverExp :: DsMonad q => [Pat] -> DExp -> q ([DPat], DExp) Source #

Desugar multiple patterns. Like `dsPatOverExp`.

dsPatX :: DsMonad q => Pat -> q (DPat, [(Name, DExp)]) Source #

Desugar a pattern, returning a list of (Name, DExp) pairs of extra variables that must be bound within the scope of the pattern

dsLetDecs :: DsMonad q => [Dec] -> q [DLetDec] Source #

Desugar `Dec`s that can appear in a let expression

dsTvb :: DsMonad q => TyVarBndr -> q DTyVarBndr Source #

Desugar a `TyVarBndr`

dsCxt :: DsMonad q => Cxt -> q DCxt Source #

Desugar a `Cxt`

dsCon Source #

Arguments

:: DsMonad q |
=> [DTyVarBndr] | The universally quantified type variables (used if desugaring a non-GADT constructor).
-> DType | The original data declaration's type (used if desugaring a non-GADT constructor).
-> Con |
-> q [DCon] |

Desugar a single `Con`.

Because we always desugar `Con`s to GADT syntax (see the documentation for `DCon`), it is not always possible to desugar with just a `Con` alone. For instance, we must desugar:

    data Foo a = forall b. MkFoo b

To this:

    data Foo a :: Type where
      MkFoo :: forall a b. b -> Foo a

If our only argument was `forall b. MkFoo b`, it would be somewhat awkward to figure out (1) what the set of universally quantified type variables (`[a]`) was, and (2) what the return type (`Foo a`) was. For this reason, we require passing these as arguments. (If we desugar an actual GADT constructor, these arguments are ignored.)

dsForeign :: DsMonad q => Foreign -> q DForeign Source #

Desugar a `Foreign`.

dsPragma :: DsMonad q => Pragma -> q DPragma Source #

Desugar a `Pragma`.

dsRuleBndr :: DsMonad q => RuleBndr -> q DRuleBndr Source #

Desugar a `RuleBndr`.

## Secondary desugaring functions

type PatM q = WriterT [(Name, DExp)] q Source #

Desugaring a pattern also returns the list of variables bound in as-patterns and the values they should be bound to. This variables must be brought into scope in the "body" of the pattern.

dsPred :: DsMonad q => Pred -> q DCxt Source #

Desugar a `Pred`, flattening any internal tuples

dsPat :: DsMonad q => Pat -> PatM q DPat Source #

Desugar a pattern.

dsDec :: DsMonad q => Dec -> q [DDec] Source #

Desugar a single `Dec`, perhaps producing multiple `DDec`s

dsDerivClause :: DsMonad q => DerivClause -> q DDerivClause Source #

Desugar a `DerivClause`.

dsLetDec :: DsMonad q => Dec -> q [DLetDec] Source #

Desugar a single `Dec`, perhaps producing multiple `DLetDec`s

dsMatches Source #

Arguments

:: DsMonad q |
=> Name | Name of the scrutinee, which must be a bare var
-> [Match] | Matches of the `case` statement
-> q [DMatch] |

Desugar a list of matches for a `case` statement

dsBody Source #

Arguments

:: DsMonad q |
=> Body | body to desugar
-> [Dec] | "where" declarations
-> DExp | what to do if the guards don't match
-> q DExp |

Desugar a `Body`

dsGuards Source #

Arguments

:: DsMonad q |
=> [(Guard, Exp)] | Guarded expressions
-> DExp | What to do if none of the guards match
-> q DExp |

Desugar guarded expressions

dsDoStmts :: DsMonad q => [Stmt] -> q DExp Source #

Desugar the `Stmt`s in a `do` expression

dsComp :: DsMonad q => [Stmt] -> q DExp Source #

Desugar the `Stmt`s in a list or monad comprehension

dsClauses Source #

Arguments

:: DsMonad q |
=> Name | Name of the function
-> [Clause] | Clauses to desugar
-> q [DClause] |

Desugar clauses to a function definition

dsBangType :: DsMonad q => BangType -> q DBangType Source #

Desugar a `BangType` (or a `StrictType`, if you're old-fashioned)

dsVarBangType :: DsMonad q => VarBangType -> q DVarBangType Source #

Desugar a `VarBangType` (or a `VarStrictType`, if you're old-fashioned)

dsTypeFamilyHead :: DsMonad q => TypeFamilyHead -> q DTypeFamilyHead Source #

Desugar a `TypeFamilyHead`

dsFamilyResultSig :: DsMonad q => FamilyResultSig -> q DFamilyResultSig Source #

Desugar a `FamilyResultSig`

dsPatSynDir :: DsMonad q => Name -> PatSynDir -> q DPatSynDir Source #

Desugar a `PatSynDir`. (Available only with GHC 8.2+)

# Converting desugared AST back to TH AST

module Language.Haskell.TH.Desugar.Sweeten

# Expanding type synonyms

expand :: (DsMonad q, Data a) => a -> q a Source #

Expand all type synonyms and type families in the desugared abstract syntax tree provided, where type family simplification is on a "best effort" basis. Normally, the first parameter should have a type like `DExp` or `DLetDec`.

expandType :: DsMonad q => DType -> q DType Source #

Expands all type synonyms in a desugared type. Also expands open type family applications. (In GHCs before 7.10, this part does not work if there are any variables.) Attempts to expand closed type family applications, but aborts the moment it spots anything strange, like a nested type family application or type variable.

# Reification

reifyWithWarning :: Quasi q => Name -> q Info Source #

Reify a declaration, warning the user about splices if the reify fails. The warning says that reification can fail if you try to reify a type in the same splice as it is declared.

The following definitions allow you to register a list of `Dec`s to be used in reification queries.

withLocalDeclarations :: DsMonad q => [Dec] -> DsM q a -> q a Source #

Add a list of declarations to be considered when reifying local declarations.

dsReify :: DsMonad q => Name -> q (Maybe DInfo) Source #

Like `reify`, but safer and desugared. Uses local declarations where available.

reifyWithLocals_maybe :: DsMonad q => Name -> q (Maybe Info) Source #

Like `reify` from Template Haskell, but looks also in any not-yet-typechecked declarations. To establish this list of not-yet-typechecked declarations, use `withLocalDeclarations`. Returns `Nothing` if reification fails. Note that no inferred type information is available from local declarations; bottoms may be used if necessary.

reifyWithLocals :: DsMonad q => Name -> q Info Source #

Like `reifyWithLocals_maybe`, but throws an exception upon failure, warning the user about separating splices.

reifyFixityWithLocals :: DsMonad q => Name -> q (Maybe Fixity) Source #

Like `reifyWithLocals_maybe`, but for fixities. Note that a return of `Nothing` might mean that the name is not in scope, or it might mean that the name has no assigned fixity. (Use `reifyWithLocals_maybe` if you really need to tell the difference.)

lookupValueNameWithLocals :: DsMonad q => String -> q (Maybe Name) Source #

Like `lookupValueName` from Template Haskell, but looks also in `Names` of not-yet-typechecked declarations. To establish this list of not-yet-typechecked declarations, use `withLocalDeclarations`. Returns `Nothing` if no value with the same name can be found.

lookupTypeNameWithLocals :: DsMonad q => String -> q (Maybe Name) Source #

Like `lookupTypeName` from Template Haskell, but looks also in `Names` of not-yet-typechecked declarations. To establish this list of not-yet-typechecked declarations, use `withLocalDeclarations`. Returns `Nothing` if no type with the same name can be found.

mkDataNameWithLocals :: DsMonad q => String -> q Name Source #

Like TH's `lookupValueName`, but if this name is not bound, then we assume it is declared in the current module.

Unlike `mkDataName`, this also consults the local declarations in scope when determining if the name is currently bound.

mkTypeNameWithLocals :: DsMonad q => String -> q Name Source #

Like TH's `lookupTypeName`, but if this name is not bound, then we assume it is declared in the current module.

Unlike `mkTypeName`, this also consults the local declarations in scope when determining if the name is currently bound.

reifyNameSpace :: DsMonad q => Name -> q (Maybe NameSpace) Source #

Determines a `Name`'s `NameSpace`. If the `NameSpace` is attached to the `Name` itself (i.e., it is unambiguous), then that `NameSpace` is immediately returned. Otherwise, reification is used to lookup up the `NameSpace` (consulting local declarations if necessary).

Note that if a `Name` lives in two different `NameSpaces` (which can genuinely happen--for instance, ``mkName` "=="`, where `==` is both a function and a type family), then this function will simply return whichever `NameSpace` is discovered first via reification. If you wish to find a `Name` in a particular `NameSpace`, use the `lookupValueNameWithLocals` or `lookupTypeNameWithLocals` functions.

class Quasi m => DsMonad m where Source #

A `DsMonad` stores some list of declarations that should be considered in scope. `DsM` is the prototypical inhabitant of `DsMonad`.

Methods

localDeclarations :: m [Dec] Source #

Produce a list of local declarations.

Instances

DsMonad IO Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Reify Methods localDeclarations :: IO [Dec] Source #
DsMonad Q Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Reify Methods localDeclarations :: Q [Dec] Source #
Quasi q => DsMonad (DsM q) Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Reify Methods localDeclarations :: DsM q [Dec] Source #
DsMonad m => DsMonad (ReaderT r m) Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Reify Methods localDeclarations :: ReaderT r m [Dec] Source #
DsMonad m => DsMonad (StateT s m) Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Reify Methods localDeclarations :: StateT s m [Dec] Source #
(DsMonad m, Monoid w) => DsMonad (WriterT w m) Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Reify Methods localDeclarations :: WriterT w m [Dec] Source #
(DsMonad m, Monoid w) => DsMonad (RWST r w s m) Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Reify Methods localDeclarations :: RWST r w s m [Dec] Source #

data DsM q a Source #

A convenient implementation of the `DsMonad` class. Use by calling `withLocalDeclarations`.

Instances

MonadTrans DsM Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Reify Methods lift :: Monad m => m a -> DsM m a Source #
Monad q => Monad (DsM q) Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Reify Methods (>>=) :: DsM q a -> (a -> DsM q b) -> DsM q b Source # (>>) :: DsM q a -> DsM q b -> DsM q b Source # return :: a -> DsM q a Source # fail :: String -> DsM q a Source #
Functor q => Functor (DsM q) Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Reify Methods fmap :: (a -> b) -> DsM q a -> DsM q b Source # (<$) :: a -> DsM q b -> DsM q a Source #
MonadFail q => MonadFail (DsM q) Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Reify Methods fail :: String -> DsM q a Source #
Applicative q => Applicative (DsM q) Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Reify Methods pure :: a -> DsM q a Source # (<*>) :: DsM q (a -> b) -> DsM q a -> DsM q b Source # liftA2 :: (a -> b -> c) -> DsM q a -> DsM q b -> DsM q c Source # (*>) :: DsM q a -> DsM q b -> DsM q b Source # (<*) :: DsM q a -> DsM q b -> DsM q a Source #
MonadIO q => MonadIO (DsM q) Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Reify Methods liftIO :: IO a -> DsM q a Source #
Quasi q => Quasi (DsM q) Source # |

Instance details

Defined in Language.Haskell.TH.Desugar.Reify

Methods

qNewName :: String -> DsM q Name Source #

qReport :: Bool -> String -> DsM q () Source #

qRecover :: DsM q a -> DsM q a -> DsM q a Source #

qLookupName :: Bool -> String -> DsM q (Maybe Name) Source #

qReify :: Name -> DsM q Info Source #

qReifyFixity :: Name -> DsM q (Maybe Fixity) Source #

qReifyInstances :: Name -> [Type] -> DsM q [Dec] Source #

qReifyRoles :: Name -> DsM q [Role] Source #

qReifyAnnotations :: Data a => AnnLookup -> DsM q [a] Source #

qReifyModule :: Module -> DsM q ModuleInfo Source #

qReifyConStrictness :: Name -> DsM q [DecidedStrictness] Source #

qLocation :: DsM q Loc Source #

qRunIO :: IO a -> DsM q a Source #

qAddDependentFile :: FilePath -> DsM q () Source #

qAddTempFile :: String -> DsM q FilePath Source #

qAddTopDecls :: [Dec] -> DsM q () Source #

qAddForeignFilePath :: ForeignSrcLang -> String -> DsM q () Source #

qAddModFinalizer :: Q () -> DsM q () Source #

qAddCorePlugin :: String -> DsM q () Source #

qGetQ :: Typeable a => DsM q (Maybe a) Source #

qPutQ :: Typeable a => a -> DsM q () Source #

qIsExtEnabled :: Extension -> DsM q Bool Source #

qExtsEnabled :: DsM q [Extension] Source #

Quasi q => DsMonad (DsM q) Source # |
Instance details Defined in Language.Haskell.TH.Desugar.Reify Methods localDeclarations :: DsM q [Dec] Source #

# Nested pattern flattening

scExp :: DsMonad q => DExp -> q DExp Source #

Remove all nested pattern-matches within this expression. This also removes all `DTildePa`s and `DBangPa`s. After this is run, every pattern is guaranteed to be either a `DConPa` with bare variables as arguments, a `DLitPa`, or a `DWildPa`.

scLetDec :: DsMonad q => DLetDec -> q DLetDec Source #

Like `scExp`, but for a `DLetDec`.

# Capture-avoiding substitution and utilities

module Language.Haskell.TH.Desugar.Subst

# Utility functions

applyDExp :: DExp -> [DExp] -> DExp Source #

Apply one `DExp` to a list of arguments

applyDType :: DType -> [DType] -> DType Source #

Apply one `DType` to a list of arguments

dPatToDExp :: DPat -> DExp Source #

Convert a `DPat` to a `DExp`. Fails on `DWildP`.

removeWilds :: DsMonad q => DPat -> q DPat Source #

Remove all wildcards from a pattern, replacing any wildcard with a fresh variable

getDataD Source #

Arguments

:: DsMonad q |
=> String | Print this out on failure
-> Name | Name of the datatype (`data` or `newtype`) of interest
-> q ([TyVarBndr], [Con]) |

Extract the `TyVarBndr`s and constructors given the `Name` of a type

dataConNameToDataName :: DsMonad q => Name -> q Name Source #

From the name of a data constructor, retrive the datatype definition it is a part of.

dataConNameToCon :: DsMonad q => Name -> q Con Source #

From the name of a data constructor, retrieve its definition as a `Con`

nameOccursIn :: Data a => Name -> a -> Bool Source #

Check if a name occurs anywhere within a TH tree.

allNamesIn :: Data a => a -> [Name] Source #

Extract all Names mentioned in a TH tree.

flattenDValD :: Quasi q => DLetDec -> q [DLetDec] Source #

If the declaration passed in is a `DValD`, creates new, equivalent declarations such that the `DPat` in all `DValD`s is just a plain `DVarPa`. Other declarations are passed through unchanged. Note that the declarations that come out of this function are rather less efficient than those that come in: they have many more pattern matches.

getRecordSelectors Source #

Arguments

:: Quasi q |
=> DType | the type of the argument
-> [DCon] |
-> q [DLetDec] |

Produces `DLetDec`s representing the record selector functions from the provided `DCon`s.

Note that if the same record selector appears in multiple constructors, `getRecordSelectors` will return only one binding for that selector. For example, if you had:

    data X = X1 {y :: Symbol} | X2 {y :: Symbol}

Then calling `getRecordSelectors` on `[X1, X2]` will return:

    [ DSigD y (DAppT (DAppT DArrowT (DConT X)) (DConT Symbol))
    , DFunD y [ DClause [DConPa X1 [DVarPa field]] (DVarE field)
              , DClause [DConPa X2 [DVarPa field]] (DVarE field) ] ]

instead of returning one binding for `X1` and another binding for `X2`.

`getRecordSelectors` attempts to filter out "naughty" record selectors whose types mention existentially quantified type variables. But see the documentation for `conExistentialTvbs` for limitations to this approach.

mkTypeName :: Quasi q => String -> q Name Source #

Like TH's `lookupTypeName`, but if this name is not bound, then we assume it is declared in the current module.

mkDataName :: Quasi q => String -> q Name Source #

Like TH's `lookupDataName`, but if this name is not bound, then we assume it is declared in the current module.

newUniqueName :: Quasi q => String -> q Name Source #

Like newName, but even more unique (unique across different splices), and with unique `nameBase`s. Precondition: the string is a valid Haskell alphanumeric identifier (could be upper- or lower-case).

mkTupleDExp :: [DExp] -> DExp Source #

Make a tuple `DExp` from a list of `DExp`s. Avoids using a 1-tuple.

mkTupleDPat :: [DPat] -> DPat Source #

Make a tuple `DPat` from a list of `DPat`s. Avoids using a 1-tuple.

maybeDLetE :: [DLetDec] -> DExp -> DExp Source #

If decs is non-empty, delcare them in a let:

maybeDCaseE :: String -> DExp -> [DMatch] -> DExp Source #

If matches is non-empty, make a case statement; otherwise make an error statement

mkDLamEFromDPats :: DsMonad q => [DPat] -> DExp -> q DExp Source #

Convert a list of `DPat` arguments and a `DExp` body into a `DLamE`. This is needed since `DLamE` takes a list of `Name`s for its bound variables instead of `DPat`s, so some reorganization is needed.

fvDType :: DType -> Set Name Source #

tupleDegree_maybe :: String -> Maybe Int Source #

Extract the degree of a tuple

tupleNameDegree_maybe :: Name -> Maybe Int Source #

Extract the degree of a tuple name

unboxedSumDegree_maybe :: String -> Maybe Int Source #

Extract the degree of an unboxed sum

unboxedSumNameDegree_maybe :: Name -> Maybe Int Source #

Extract the degree of an unboxed sum name

unboxedTupleDegree_maybe :: String -> Maybe Int Source #

Extract the degree of an unboxed tuple

unboxedTupleNameDegree_maybe :: Name -> Maybe Int Source #

Extract the degree of an unboxed tuple name

strictToBang :: Bang -> Bang Source #

Convert a `Strict` to a `Bang` in GHCs 7.x. This is just the identity operation in GHC 8.x, which has no `Strict`. (This is included in GHC 8.x only for good Haddocking.)

isTypeKindName :: Name -> Bool Source #

Returns `True` if the argument `Name` is that of `Type` (or `*` or `★`, to support older GHCs).

typeKindName :: Name Source #

The `Name` of:

1. The kind `Type`, on GHC 8.0 or later.
2. The kind `*` on older GHCs.

unravel :: DType -> ([DTyVarBndr], [DPred], [DType], DType) Source #

Decompose a function type into its type variables, its context, its argument types, and its result type.

conExistentialTvbs Source #

Arguments

:: DsMonad q |
=> DType | The type of the original data declaration
-> DCon |
-> q [DTyVarBndr] |

Returns all of a constructor's existentially quantified type variable binders.

Detecting the presence of existentially quantified type variables in the context of Template Haskell is quite involved. Here is an example that we will use to explain how this works:

    data family Foo a b
    data instance Foo (Maybe a) b where
      MkFoo :: forall x y z. x -> y -> z -> Foo (Maybe x) [z]

In `MkFoo`, `x` is universally quantified, whereas `y` and `z` are existentially quantified. Note that `MkFoo` desugars (in Core) to something like this:

    data instance Foo (Maybe a) b where
      MkFoo :: forall a b y z. (b ~ [z]). a -> y -> z -> Foo (Maybe a) b

Here, we can see that `a` appears in the desugared return type (it is a simple alpha-renaming of `x`), so it is universally quantified. On the other hand, neither `y` nor `z` appear in the desugared return type, so they are existentially quantified.

This analysis would not have been possible without knowing what the original data declaration's type was (in this case, `Foo (Maybe a) b`), which is why we require it as an argument. Our algorithm for detecting existentially quantified variables is not too different from what was described above: we match the constructor's return type with the original data type, forming a substitution, and check which quantified variables are not part of the domain of the substitution.

Be warned: this may overestimate which variables are existentially quantified when kind variables are involved. For instance, consider this example:

    data S k (a :: k)
    data T a where
      MkT :: forall k (a :: k). { foo :: Proxy (a :: k), bar :: S k a } -> T a

Here, the kind variable `k` does not appear syntactically in the return type `T a`, so `conExistentialTvbs` would mistakenly flag `k` as existential.

There are various tricks we could employ to improve this, but ultimately, making this behave correctly with respect to `PolyKinds` 100% of the time would amount to performing kind inference in Template Haskell, which is quite difficult. For the sake of simplicity, we have decided to stick with a dumb-but-predictable syntactic check.

mkExtraDKindBinders :: DsMonad q => DKind -> q [DTyVarBndr] Source #

Create new kind variable binder names corresponding to the return kind of a data type. This is useful when you have a data type like:

    data Foo :: forall k. k -> Type -> Type where ...

But you want to be able to refer to the type `Foo a b`. `mkExtraDKindBinders` will take the kind `forall k. k -> Type -> Type`, discover that is has two visible argument kinds, and return as a result two new kind variable binders `[a :: k, b :: Type]`, where `a` and `b` are fresh type variable names.

This expands kind synonyms if necessary.

dTyVarBndrToDType :: DTyVarBndr -> DType Source #

Convert a `DTyVarBndr` into a `DType`

toposortTyVarsOf :: [DType] -> [DTyVarBndr] Source #

Take a list of `DType`s, find their free variables, and sort them in reverse topological order to ensure that they are well scoped.

On older GHCs, this takes measures to avoid returning explicitly bound kind variables, which was not possible before `TypeInType`.

## Extracting bound names

extractBoundNamesStmt :: Stmt -> Set Name Source #

Extract the names bound in a `Stmt`

extractBoundNamesDec :: Dec -> Set Name Source #

Extract the names bound in a `Dec` that could appear in a `let` expression.

extractBoundNamesPat :: Pat -> Set Name Source #

Extract the names bound in a `Pat`