GHC.Hs.Binds

ghc-lib-parser-9.14.1.20251220: The GHC API, decoupled from GHC versions

Safe Haskell | Ignore
Language | GHC2021

GHC.Hs.Binds

Contents

- Orphan instances

Synopsis

- module Language.Haskell.Syntax.Binds
- data NamespaceSpecifier
  - = NoNamespaceSpecifier
  - | TypeNamespaceSpecifier (EpToken "type")
  - | DataNamespaceSpecifier (EpToken "data")
- ppr_sig :: forall (p :: Pass). OutputableBndrId p => Sig (GhcPass p) -> SDoc
- data HsRuleBndrsAnn = HsRuleBndrsAnn {
  - rb_tyanns :: Maybe (TokForall, EpToken ".")
  - rb_tmanns :: Maybe (TokForall, EpToken ".")
  }
- hsSigDoc :: forall (p :: Pass). IsPass p => Sig (GhcPass p) -> SDoc
- data NHsValBindsLR idL = NValBinds [(RecFlag, LHsBinds idL)] [LSig GhcRn]
- type family XVarBindGhc (pL :: Pass) (pR :: Pass) where ...
- data AbsBinds = AbsBinds {
  - abs_tvs :: [TyVar]
  - abs_ev_vars :: [EvVar]
  - abs_exports :: [ABExport]
  - abs_ev_binds :: [TcEvBinds]
  - abs_binds :: LHsBinds GhcTc
  - abs_sig :: Bool
  }
- data AnnPSB = AnnPSB {
  - ap_pattern :: EpToken "pattern"
  - ap_openc :: Maybe (EpToken "{")
  - ap_closec :: Maybe (EpToken "}")
  - ap_larrow :: Maybe (EpUniToken "<-" "\8592")
  - ap_equal :: Maybe (EpToken "=")
  }
- setTcMultAnn :: Mult -> HsMultAnn GhcRn -> HsMultAnn GhcTc
- getTcMultAnn :: HsMultAnn GhcTc -> Mult
- data ABExport = ABE {
  - abe_poly :: Id
  - abe_mono :: Id
  - abe_wrap :: HsWrapper
  - abe_prags :: TcSpecPrags
  }
- data TcSpecPrags
  - = IsDefaultMethod
  - | SpecPrags [LTcSpecPrag]
- pprDeclList :: [SDoc] -> SDoc
- pprLHsBindsForUser :: forall (idL :: Pass) (idR :: Pass) (id2 :: Pass). (OutputableBndrId idL, OutputableBndrId idR, OutputableBndrId id2) => LHsBindsLR (GhcPass idL) (GhcPass idR) -> [LSig (GhcPass id2)] -> [SDoc]
- pprLHsBinds :: forall (idL :: Pass) (idR :: Pass). (OutputableBndrId idL, OutputableBndrId idR) => LHsBindsLR (GhcPass idL) (GhcPass idR) -> SDoc
- isEmptyLHsBinds :: forall (idL :: Pass) idR. LHsBindsLR (GhcPass idL) idR -> Bool
- emptyLocalBinds :: forall (a :: Pass) (b :: Pass). HsLocalBindsLR (GhcPass a) (GhcPass b)
- eqEmptyLocalBinds :: HsLocalBindsLR a b -> Bool
- isEmptyValBinds :: forall (a :: Pass) (b :: Pass). HsValBindsLR (GhcPass a) (GhcPass b) -> Bool
- emptyValBindsIn :: forall (a :: Pass) (b :: Pass). HsValBindsLR (GhcPass a) (GhcPass b)
- emptyValBindsOut :: forall (a :: Pass) (b :: Pass). HsValBindsLR (GhcPass a) (GhcPass b)
- emptyLHsBinds :: forall (idL :: Pass) idR. LHsBindsLR (GhcPass idL) idR
- plusHsValBinds :: forall (a :: Pass). HsValBinds (GhcPass a) -> HsValBinds (GhcPass a) -> HsValBinds (GhcPass a)
- ppr_monobind :: forall (idL :: Pass) (idR :: Pass). (OutputableBndrId idL, OutputableBndrId idR) => HsBindLR (GhcPass idL) (GhcPass idR) -> SDoc
- pprTicks :: SDoc -> SDoc -> SDoc
- pprTcSpecPrags :: TcSpecPrags -> SDoc
- isEmptyIPBindsPR :: forall (p :: Pass). HsIPBinds (GhcPass p) -> Bool
- isEmptyIPBindsTc :: HsIPBinds GhcTc -> Bool
- data AnnSig = AnnSig {
  - asDcolon :: EpUniToken "::" "\8759"
  - asPattern :: Maybe (EpToken "pattern")
  - asDefault :: Maybe (EpToken "default")
  }
- data ActivationAnn = ActivationAnn {
  - aa_openc :: EpToken "["
  - aa_closec :: EpToken "]"
  - aa_tilde :: Maybe (EpToken "~")
  - aa_val :: Maybe EpaLocation
  }
- data AnnSpecSig = AnnSpecSig {
  - ass_open :: EpaLocation
  - ass_close :: EpToken "#-}"
  - ass_dcolon :: Maybe TokDcolon
  - ass_act :: ActivationAnn
  }
- newtype IdSig = IdSig {
  - unIdSig :: Id
  }
- overlappingNamespaceSpecifiers :: NamespaceSpecifier -> NamespaceSpecifier -> Bool
- coveredByNamespaceSpecifier :: NamespaceSpecifier -> NameSpace -> Bool
- type LTcSpecPrag = Located TcSpecPrag
- data TcSpecPrag
  - = SpecPrag Id HsWrapper InlinePragma
  - | SpecPragE {
    - spe_fn_nm :: Name
    - spe_fn_id :: Id
    - spe_inl :: InlinePragma
    - spe_bndrs :: [Var]
    - spe_call :: LHsExpr GhcTc
    }
- noSpecPrags :: TcSpecPrags
- hasSpecPrags :: TcSpecPrags -> Bool
- isDefaultMethod :: TcSpecPrags -> Bool
- pprVarSig :: OutputableBndr id => [id] -> SDoc -> SDoc
- pragSrcBrackets :: SourceText -> String -> SDoc -> SDoc
- pprSpec :: OutputableBndr id => id -> SDoc -> InlinePragma -> SDoc
- extractSpecPragName :: SourceText -> String
- pprMinimalSig :: forall (p :: Pass). OutputableBndrId p => LBooleanFormula (GhcPass p) -> SDoc
- pragBrackets :: SDoc -> SDoc
- data HsRuleBndrsAnn = HsRuleBndrsAnn {
  - rb_tyanns :: Maybe (TokForall, EpToken ".")
  - rb_tmanns :: Maybe (TokForall, EpToken ".")
  }

# Documentation

module Language.Haskell.Syntax.Binds

data NamespaceSpecifier #

Optional namespace specifier for fixity signatures, WARNINIG and DEPRECATED pragmas.

Examples:

{-# WARNING in "x-partial" data Head "don't use this pattern synonym" #-} -- ↑ DataNamespaceSpecifier

{-# DEPRECATED type D "This type was deprecated" #-} -- ↑ TypeNamespaceSpecifier

infixr 6 data $ -- ↑ DataNamespaceSpecifier

Constructors

NoNamespaceSpecifier |
TypeNamespaceSpecifier (EpToken "type") |
DataNamespaceSpecifier (EpToken "data") |

#### Instances

Instances details

Data NamespaceSpecifier # |
Instance details Defined in GHC.Hs.Binds Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NamespaceSpecifier -> c NamespaceSpecifier # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c NamespaceSpecifier # toConstr :: NamespaceSpecifier -> Constr # dataTypeOf :: NamespaceSpecifier -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c NamespaceSpecifier) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NamespaceSpecifier) # gmapT :: (forall b. Data b => b -> b) -> NamespaceSpecifier -> NamespaceSpecifier # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NamespaceSpecifier -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NamespaceSpecifier -> r # gmapQ :: (forall d. Data d => d -> u) -> NamespaceSpecifier -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> NamespaceSpecifier -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> NamespaceSpecifier -> m NamespaceSpecifier # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NamespaceSpecifier -> m NamespaceSpecifier # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NamespaceSpecifier -> m NamespaceSpecifier #
Outputable NamespaceSpecifier # |
Instance details Defined in GHC.Hs.Binds Methods ppr :: NamespaceSpecifier -> SDoc #
Eq NamespaceSpecifier # |
Instance details Defined in GHC.Hs.Binds Methods (==) :: NamespaceSpecifier -> NamespaceSpecifier -> Bool # (/=) :: NamespaceSpecifier -> NamespaceSpecifier -> Bool #

ppr_sig :: forall (p :: Pass). OutputableBndrId p => Sig (GhcPass p) -> SDoc #

data HsRuleBndrsAnn #

Constructors

HsRuleBndrsAnn |
Fields rb_tyanns :: Maybe (TokForall, EpToken ".") The locations of 'forall' and `.` for forall'd type vars Using AddEpAnn to capture possible unicode variants rb_tmanns :: Maybe (TokForall, EpToken ".") The locations of 'forall' and `.` for forall'd term vars Using AddEpAnn to capture possible unicode variants

#### Instances

Instances details

Data HsRuleBndrsAnn # |
Instance details Defined in GHC.Hs.Binds Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> HsRuleBndrsAnn -> c HsRuleBndrsAnn # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c HsRuleBndrsAnn # toConstr :: HsRuleBndrsAnn -> Constr # dataTypeOf :: HsRuleBndrsAnn -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c HsRuleBndrsAnn) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c HsRuleBndrsAnn) # gmapT :: (forall b. Data b => b -> b) -> HsRuleBndrsAnn -> HsRuleBndrsAnn # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HsRuleBndrsAnn -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HsRuleBndrsAnn -> r # gmapQ :: (forall d. Data d => d -> u) -> HsRuleBndrsAnn -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> HsRuleBndrsAnn -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> HsRuleBndrsAnn -> m HsRuleBndrsAnn # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HsRuleBndrsAnn -> m HsRuleBndrsAnn # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HsRuleBndrsAnn -> m HsRuleBndrsAnn #
NoAnn HsRuleBndrsAnn # |
Instance details Defined in GHC.Hs.Binds Methods noAnn :: HsRuleBndrsAnn #
Eq HsRuleBndrsAnn # |
Instance details Defined in GHC.Hs.Binds Methods (==) :: HsRuleBndrsAnn -> HsRuleBndrsAnn -> Bool # (/=) :: HsRuleBndrsAnn -> HsRuleBndrsAnn -> Bool #

hsSigDoc :: forall (p :: Pass). IsPass p => Sig (GhcPass p) -> SDoc #

data NHsValBindsLR idL #

Constructors

NValBinds [(RecFlag, LHsBinds idL)] [LSig GhcRn] |

#### Instances

Instances details

Data (NHsValBindsLR GhcPs) # |
Instance details Defined in GHC.Hs.Instances Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NHsValBindsLR GhcPs -> c (NHsValBindsLR GhcPs) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (NHsValBindsLR GhcPs) # toConstr :: NHsValBindsLR GhcPs -> Constr # dataTypeOf :: NHsValBindsLR GhcPs -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (NHsValBindsLR GhcPs)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (NHsValBindsLR GhcPs)) # gmapT :: (forall b. Data b => b -> b) -> NHsValBindsLR GhcPs -> NHsValBindsLR GhcPs # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NHsValBindsLR GhcPs -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NHsValBindsLR GhcPs -> r # gmapQ :: (forall d. Data d => d -> u) -> NHsValBindsLR GhcPs -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> NHsValBindsLR GhcPs -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> NHsValBindsLR GhcPs -> m (NHsValBindsLR GhcPs) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NHsValBindsLR GhcPs -> m (NHsValBindsLR GhcPs) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NHsValBindsLR GhcPs -> m (NHsValBindsLR GhcPs) #
Data (NHsValBindsLR GhcRn) # |
Instance details Defined in GHC.Hs.Instances Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NHsValBindsLR GhcRn -> c (NHsValBindsLR GhcRn) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (NHsValBindsLR GhcRn) # toConstr :: NHsValBindsLR GhcRn -> Constr # dataTypeOf :: NHsValBindsLR GhcRn -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (NHsValBindsLR GhcRn)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (NHsValBindsLR GhcRn)) # gmapT :: (forall b. Data b => b -> b) -> NHsValBindsLR GhcRn -> NHsValBindsLR GhcRn # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NHsValBindsLR GhcRn -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NHsValBindsLR GhcRn -> r # gmapQ :: (forall d. Data d => d -> u) -> NHsValBindsLR GhcRn -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> NHsValBindsLR GhcRn -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> NHsValBindsLR GhcRn -> m (NHsValBindsLR GhcRn) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NHsValBindsLR GhcRn -> m (NHsValBindsLR GhcRn) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NHsValBindsLR GhcRn -> m (NHsValBindsLR GhcRn) #
Data (NHsValBindsLR GhcTc) # |
Instance details Defined in GHC.Hs.Instances Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NHsValBindsLR GhcTc -> c (NHsValBindsLR GhcTc) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (NHsValBindsLR GhcTc) # toConstr :: NHsValBindsLR GhcTc -> Constr # dataTypeOf :: NHsValBindsLR GhcTc -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (NHsValBindsLR GhcTc)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (NHsValBindsLR GhcTc)) # gmapT :: (forall b. Data b => b -> b) -> NHsValBindsLR GhcTc -> NHsValBindsLR GhcTc # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NHsValBindsLR GhcTc -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NHsValBindsLR GhcTc -> r # gmapQ :: (forall d. Data d => d -> u) -> NHsValBindsLR GhcTc -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> NHsValBindsLR GhcTc -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> NHsValBindsLR GhcTc -> m (NHsValBindsLR GhcTc) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NHsValBindsLR GhcTc -> m (NHsValBindsLR GhcTc) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NHsValBindsLR GhcTc -> m (NHsValBindsLR GhcTc) #

type family XVarBindGhc (pL :: Pass) (pR :: Pass) where ... #

Equations

XVarBindGhc 'Typechecked 'Typechecked = NoExtField |
XVarBindGhc _1 _2 = DataConCantHappen |

data AbsBinds #

Typechecked, generalised bindings, used in the output to the type checker. See Note [AbsBinds].

Constructors

AbsBinds |
Fields abs_tvs :: [TyVar] abs_ev_vars :: [EvVar] Includes equality constraints abs_exports :: [ABExport] AbsBinds only gets used when idL = idR after renaming, but these need to be idL's for the collect... code in HsUtil to have the right type abs_ev_binds :: [TcEvBinds] Evidence bindings Why a list? See GHC.Tc.TyCl.Instance Note [Typechecking plan for instance declarations] abs_binds :: LHsBinds GhcTc Typechecked user bindings abs_sig :: Bool

#### Instances

Instances details

Data AbsBinds # |
Instance details Defined in GHC.Hs.Instances Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> AbsBinds -> c AbsBinds # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c AbsBinds # toConstr :: AbsBinds -> Constr # dataTypeOf :: AbsBinds -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c AbsBinds) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c AbsBinds) # gmapT :: (forall b. Data b => b -> b) -> AbsBinds -> AbsBinds # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> AbsBinds -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> AbsBinds -> r # gmapQ :: (forall d. Data d => d -> u) -> AbsBinds -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> AbsBinds -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> AbsBinds -> m AbsBinds # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> AbsBinds -> m AbsBinds # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> AbsBinds -> m AbsBinds #

data AnnPSB #

Constructors

AnnPSB |
Fields ap_pattern :: EpToken "pattern" ap_openc :: Maybe (EpToken "{") ap_closec :: Maybe (EpToken "}") ap_larrow :: Maybe (EpUniToken "<-" "\8592") ap_equal :: Maybe (EpToken "=")

#### Instances

Instances details

Data AnnPSB # |
Instance details Defined in GHC.Hs.Binds Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> AnnPSB -> c AnnPSB # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c AnnPSB # toConstr :: AnnPSB -> Constr # dataTypeOf :: AnnPSB -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c AnnPSB) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c AnnPSB) # gmapT :: (forall b. Data b => b -> b) -> AnnPSB -> AnnPSB # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> AnnPSB -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> AnnPSB -> r # gmapQ :: (forall d. Data d => d -> u) -> AnnPSB -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> AnnPSB -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> AnnPSB -> m AnnPSB # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> AnnPSB -> m AnnPSB # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> AnnPSB -> m AnnPSB #
NoAnn AnnPSB # |
Instance details Defined in GHC.Hs.Binds Methods noAnn :: AnnPSB #

setTcMultAnn :: Mult -> HsMultAnn GhcRn -> HsMultAnn GhcTc #

getTcMultAnn :: HsMultAnn GhcTc -> Mult #

data ABExport #

Abstraction Bindings Export

Constructors

ABE |
Fields abe_poly :: Id Any INLINE pragma is attached to this Id abe_mono :: Id abe_wrap :: HsWrapper See Note [ABExport wrapper] Shape: (forall abs_tvs. abs_ev_vars => abe_mono) ~ abe_poly abe_prags :: TcSpecPrags SPECIALISE pragmas

#### Instances

Instances details

Data ABExport # |
Instance details Defined in GHC.Hs.Instances Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ABExport -> c ABExport # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ABExport # toConstr :: ABExport -> Constr # dataTypeOf :: ABExport -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ABExport) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ABExport) # gmapT :: (forall b. Data b => b -> b) -> ABExport -> ABExport # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ABExport -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ABExport -> r # gmapQ :: (forall d. Data d => d -> u) -> ABExport -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ABExport -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ABExport -> m ABExport # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ABExport -> m ABExport # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ABExport -> m ABExport #
Outputable ABExport # |
Instance details Defined in GHC.Hs.Binds Methods ppr :: ABExport -> SDoc #

data TcSpecPrags #

Type checker Specialisation Pragmas

`TcSpecPrags` conveys `SPECIALISE` pragmas from the type checker to the desugarer

Constructors

IsDefaultMethod | Super-specialised: a default method should be macro-expanded at every call site
SpecPrags [LTcSpecPrag] |

#### Instances

Instances details

Data TcSpecPrags # |
Instance details Defined in GHC.Hs.Instances Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TcSpecPrags -> c TcSpecPrags # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TcSpecPrags # toConstr :: TcSpecPrags -> Constr # dataTypeOf :: TcSpecPrags -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TcSpecPrags) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TcSpecPrags) # gmapT :: (forall b. Data b => b -> b) -> TcSpecPrags -> TcSpecPrags # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TcSpecPrags -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TcSpecPrags -> r # gmapQ :: (forall d. Data d => d -> u) -> TcSpecPrags -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> TcSpecPrags -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> TcSpecPrags -> m TcSpecPrags # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TcSpecPrags -> m TcSpecPrags # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TcSpecPrags -> m TcSpecPrags #

pprDeclList :: [SDoc] -> SDoc #

pprLHsBindsForUser :: forall (idL :: Pass) (idR :: Pass) (id2 :: Pass). (OutputableBndrId idL, OutputableBndrId idR, OutputableBndrId id2) => LHsBindsLR (GhcPass idL) (GhcPass idR) -> [LSig (GhcPass id2)] -> [SDoc] #

pprLHsBinds :: forall (idL :: Pass) (idR :: Pass). (OutputableBndrId idL, OutputableBndrId idR) => LHsBindsLR (GhcPass idL) (GhcPass idR) -> SDoc #

isEmptyLHsBinds :: forall (idL :: Pass) idR. LHsBindsLR (GhcPass idL) idR -> Bool #

emptyLocalBinds :: forall (a :: Pass) (b :: Pass). HsLocalBindsLR (GhcPass a) (GhcPass b) #

eqEmptyLocalBinds :: HsLocalBindsLR a b -> Bool #

isEmptyValBinds :: forall (a :: Pass) (b :: Pass). HsValBindsLR (GhcPass a) (GhcPass b) -> Bool #

emptyValBindsIn :: forall (a :: Pass) (b :: Pass). HsValBindsLR (GhcPass a) (GhcPass b) #

emptyValBindsOut :: forall (a :: Pass) (b :: Pass). HsValBindsLR (GhcPass a) (GhcPass b) #

emptyLHsBinds :: forall (idL :: Pass) idR. LHsBindsLR (GhcPass idL) idR #

plusHsValBinds :: forall (a :: Pass). HsValBinds (GhcPass a) -> HsValBinds (GhcPass a) -> HsValBinds (GhcPass a) #

ppr_monobind :: forall (idL :: Pass) (idR :: Pass). (OutputableBndrId idL, OutputableBndrId idR) => HsBindLR (GhcPass idL) (GhcPass idR) -> SDoc #

pprTicks :: SDoc -> SDoc -> SDoc #

pprTcSpecPrags :: TcSpecPrags -> SDoc #

isEmptyIPBindsPR :: forall (p :: Pass). HsIPBinds (GhcPass p) -> Bool #

isEmptyIPBindsTc :: HsIPBinds GhcTc -> Bool #

data AnnSig #

Constructors

AnnSig |
Fields asDcolon :: EpUniToken "::" "\8759" asPattern :: Maybe (EpToken "pattern") asDefault :: Maybe (EpToken "default")

#### Instances

Instances details

Data AnnSig # |
Instance details Defined in GHC.Hs.Binds Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> AnnSig -> c AnnSig # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c AnnSig # toConstr :: AnnSig -> Constr # dataTypeOf :: AnnSig -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c AnnSig) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c AnnSig) # gmapT :: (forall b. Data b => b -> b) -> AnnSig -> AnnSig # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> AnnSig -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> AnnSig -> r # gmapQ :: (forall d. Data d => d -> u) -> AnnSig -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> AnnSig -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> AnnSig -> m AnnSig # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> AnnSig -> m AnnSig # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> AnnSig -> m AnnSig #
NoAnn AnnSig # |
Instance details Defined in GHC.Hs.Binds Methods noAnn :: AnnSig #

data ActivationAnn #

Constructors

ActivationAnn |
Fields aa_openc :: EpToken "[" aa_closec :: EpToken "]" aa_tilde :: Maybe (EpToken "~") aa_val :: Maybe EpaLocation

#### Instances

Instances details

Data ActivationAnn # |
Instance details Defined in GHC.Hs.Binds Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ActivationAnn -> c ActivationAnn # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ActivationAnn # toConstr :: ActivationAnn -> Constr # dataTypeOf :: ActivationAnn -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ActivationAnn) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ActivationAnn) # gmapT :: (forall b. Data b => b -> b) -> ActivationAnn -> ActivationAnn # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ActivationAnn -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ActivationAnn -> r # gmapQ :: (forall d. Data d => d -> u) -> ActivationAnn -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ActivationAnn -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ActivationAnn -> m ActivationAnn # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ActivationAnn -> m ActivationAnn # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ActivationAnn -> m ActivationAnn #
NoAnn ActivationAnn # |
Instance details Defined in GHC.Hs.Binds Methods noAnn :: ActivationAnn #
Eq ActivationAnn # |
Instance details Defined in GHC.Hs.Binds Methods (==) :: ActivationAnn -> ActivationAnn -> Bool # (/=) :: ActivationAnn -> ActivationAnn -> Bool #

data AnnSpecSig #

Constructors

AnnSpecSig |
Fields ass_open :: EpaLocation ass_close :: EpToken "#-}" ass_dcolon :: Maybe TokDcolon ass_act :: ActivationAnn

#### Instances

Instances details

Data AnnSpecSig # |
Instance details Defined in GHC.Hs.Binds Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> AnnSpecSig -> c AnnSpecSig # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c AnnSpecSig # toConstr :: AnnSpecSig -> Constr # dataTypeOf :: AnnSpecSig -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c AnnSpecSig) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c AnnSpecSig) # gmapT :: (forall b. Data b => b -> b) -> AnnSpecSig -> AnnSpecSig # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> AnnSpecSig -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> AnnSpecSig -> r # gmapQ :: (forall d. Data d => d -> u) -> AnnSpecSig -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> AnnSpecSig -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> AnnSpecSig -> m AnnSpecSig # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> AnnSpecSig -> m AnnSpecSig # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> AnnSpecSig -> m AnnSpecSig #
NoAnn AnnSpecSig # |
Instance details Defined in GHC.Hs.Binds Methods noAnn :: AnnSpecSig #

newtype IdSig #

A type signature in generated code, notably the code generated for record selectors. We simply record the desired Id itself, replete with its name, type and IdDetails. Otherwise it's just like a type signature: there should be an accompanying binding

Constructors

IdSig |
Fields unIdSig :: Id

#### Instances

Instances details

Data IdSig # |
Instance details Defined in GHC.Hs.Binds Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> IdSig -> c IdSig # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c IdSig # toConstr :: IdSig -> Constr # dataTypeOf :: IdSig -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c IdSig) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c IdSig) # gmapT :: (forall b. Data b => b -> b) -> IdSig -> IdSig # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> IdSig -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> IdSig -> r # gmapQ :: (forall d. Data d => d -> u) -> IdSig -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> IdSig -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> IdSig -> m IdSig # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> IdSig -> m IdSig # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> IdSig -> m IdSig #

overlappingNamespaceSpecifiers :: NamespaceSpecifier -> NamespaceSpecifier -> Bool #

Check if namespace specifiers overlap, i.e. if they are equal or if at least one of them doesn't specify a namespace

coveredByNamespaceSpecifier :: NamespaceSpecifier -> NameSpace -> Bool #

Check if namespace is covered by a namespace specifier: * NoNamespaceSpecifier covers both namespaces * TypeNamespaceSpecifier covers the type namespace only * DataNamespaceSpecifier covers the data namespace only

type LTcSpecPrag = Located TcSpecPrag #

Located Type checker Specialisation Pragmas

data TcSpecPrag #

Type checker Specialisation Pragma

This data type is used to communicate between the typechecker and the desugarer.

Constructors

SpecPrag | Old-form specialise pragma
Fields Id `Id` to be specialised HsWrapper wrapper that specialises the polymorphic function InlinePragma inlining spec for the specialised function | New-form specialise pragma
SpecPragE |
Fields spe_fn_nm :: Name `Name` of the `Id` being specialised spe_fn_id :: Id `Id` being specialised Note that `spe_fn_nm` may differ from ``idName` `spe_fn_id`` in the case of instance methods, where the `Name` is the class-op selector but the `spe_fn_id` is that for the local method spe_inl :: InlinePragma (optional) INLINE annotation and activation phase annotation spe_bndrs :: [Var] TyVars, EvVars, and Ids spe_call :: LHsExpr GhcTc The type-checked specialise expression

#### Instances

Instances details

Data TcSpecPrag # |
Instance details Defined in GHC.Hs.Instances Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TcSpecPrag -> c TcSpecPrag # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TcSpecPrag # toConstr :: TcSpecPrag -> Constr # dataTypeOf :: TcSpecPrag -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TcSpecPrag) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TcSpecPrag) # gmapT :: (forall b. Data b => b -> b) -> TcSpecPrag -> TcSpecPrag # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TcSpecPrag -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TcSpecPrag -> r # gmapQ :: (forall d. Data d => d -> u) -> TcSpecPrag -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> TcSpecPrag -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> TcSpecPrag -> m TcSpecPrag # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TcSpecPrag -> m TcSpecPrag # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TcSpecPrag -> m TcSpecPrag #
Outputable TcSpecPrag # |
Instance details Defined in GHC.Hs.Binds Methods ppr :: TcSpecPrag -> SDoc #

noSpecPrags :: TcSpecPrags #

hasSpecPrags :: TcSpecPrags -> Bool #

isDefaultMethod :: TcSpecPrags -> Bool #

pprVarSig :: OutputableBndr id => [id] -> SDoc -> SDoc #

pragSrcBrackets :: SourceText -> String -> SDoc -> SDoc #

Using SourceText in case the pragma was spelled differently or used mixed case

pprSpec :: OutputableBndr id => id -> SDoc -> InlinePragma -> SDoc #

extractSpecPragName :: SourceText -> String #

Extracts the name for a SPECIALIZE instance pragma. In `hsSigDoc`, the src field of `SpecInstSig` signature contains the SourceText for a SPECIALIZE instance pragma of the form: "SourceText {-# SPECIALIZE"

Extraction ensures that all variants of the pragma name (with a `Z` or an `S`) are output exactly as used in the pragma.

pprMinimalSig :: forall (p :: Pass). OutputableBndrId p => LBooleanFormula (GhcPass p) -> SDoc #

pragBrackets :: SDoc -> SDoc #

data HsRuleBndrsAnn #

Constructors

HsRuleBndrsAnn |
Fields rb_tyanns :: Maybe (TokForall, EpToken ".") The locations of 'forall' and `.` for forall'd type vars Using AddEpAnn to capture possible unicode variants rb_tmanns :: Maybe (TokForall, EpToken ".") The locations of 'forall' and `.` for forall'd term vars Using AddEpAnn to capture possible unicode variants

#### Instances

Instances details

Data HsRuleBndrsAnn # |
Instance details Defined in GHC.Hs.Binds Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> HsRuleBndrsAnn -> c HsRuleBndrsAnn # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c HsRuleBndrsAnn # toConstr :: HsRuleBndrsAnn -> Constr # dataTypeOf :: HsRuleBndrsAnn -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c HsRuleBndrsAnn) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c HsRuleBndrsAnn) # gmapT :: (forall b. Data b => b -> b) -> HsRuleBndrsAnn -> HsRuleBndrsAnn # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HsRuleBndrsAnn -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HsRuleBndrsAnn -> r # gmapQ :: (forall d. Data d => d -> u) -> HsRuleBndrsAnn -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> HsRuleBndrsAnn -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> HsRuleBndrsAnn -> m HsRuleBndrsAnn # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HsRuleBndrsAnn -> m HsRuleBndrsAnn # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HsRuleBndrsAnn -> m HsRuleBndrsAnn #
NoAnn HsRuleBndrsAnn # |
Instance details Defined in GHC.Hs.Binds Methods noAnn :: HsRuleBndrsAnn #
Eq HsRuleBndrsAnn # |
Instance details Defined in GHC.Hs.Binds Methods (==) :: HsRuleBndrsAnn -> HsRuleBndrsAnn -> Bool # (/=) :: HsRuleBndrsAnn -> HsRuleBndrsAnn -> Bool #

# Orphan instances

OutputableBndrId p => Outputable (FixitySig (GhcPass p)) # |
Instance details Methods ppr :: FixitySig (GhcPass p) -> SDoc #
OutputableBndrId p => Outputable (HsIPBinds (GhcPass p)) # |
Instance details Methods ppr :: HsIPBinds (GhcPass p) -> SDoc #
OutputableBndrId p => Outputable (IPBind (GhcPass p)) # |
Instance details Methods ppr :: IPBind (GhcPass p) -> SDoc #
Outputable (XRecGhc (IdGhcP p)) => Outputable (RecordPatSynField (GhcPass p)) # |
Instance details Methods ppr :: RecordPatSynField (GhcPass p) -> SDoc #
OutputableBndrId p => Outputable (RuleBndr (GhcPass p)) # |
Instance details Methods ppr :: RuleBndr (GhcPass p) -> SDoc #
OutputableBndrId p => Outputable (RuleBndrs (GhcPass p)) # |
Instance details Methods ppr :: RuleBndrs (GhcPass p) -> SDoc #
OutputableBndrId p => Outputable (Sig (GhcPass p)) # |
Instance details Methods ppr :: Sig (GhcPass p) -> SDoc #
(OutputableBndrId pl, OutputableBndrId pr) => Outputable (HsBindLR (GhcPass pl) (GhcPass pr)) # |
Instance details Methods ppr :: HsBindLR (GhcPass pl) (GhcPass pr) -> SDoc #
(OutputableBndrId pl, OutputableBndrId pr) => Outputable (HsLocalBindsLR (GhcPass pl) (GhcPass pr)) # |
Instance details Methods ppr :: HsLocalBindsLR (GhcPass pl) (GhcPass pr) -> SDoc #
(OutputableBndrId pl, OutputableBndrId pr) => Outputable (HsValBindsLR (GhcPass pl) (GhcPass pr)) # |
Instance details Methods ppr :: HsValBindsLR (GhcPass pl) (GhcPass pr) -> SDoc #
(OutputableBndrId l, OutputableBndrId r) => Outputable (PatSynBind (GhcPass l) (GhcPass r)) # |
Instance details Methods ppr :: PatSynBind (GhcPass l) (GhcPass r) -> SDoc #