HsBinds

ghc-8.4.4: The GHC API

Safe Haskell | None
Language | Haskell2010

HsBinds

Synopsis

- type HsLocalBinds id = HsLocalBindsLR id id
- type LHsLocalBinds id = Located (HsLocalBinds id)
- data HsLocalBindsLR idL idR
  - = HsValBinds (HsValBindsLR idL idR)
  - | HsIPBinds (HsIPBinds idR)
  - | EmptyLocalBinds
- type LHsLocalBindsLR idL idR = Located (HsLocalBindsLR idL idR)
- type HsValBinds id = HsValBindsLR id id
- data HsValBindsLR idL idR
  - = ValBindsIn (LHsBindsLR idL idR) [LSig idR]
  - | ValBindsOut [(RecFlag, LHsBinds idL)] [LSig GhcRn]
- type LHsBind id = LHsBindLR id id
- type LHsBinds id = LHsBindsLR id id
- type HsBind id = HsBindLR id id
- type LHsBindsLR idL idR = Bag (LHsBindLR idL idR)
- type LHsBindLR idL idR = Located (HsBindLR idL idR)
- data HsBindLR idL idR
  - = FunBind {
    - fun_id :: Located (IdP idL)
    - fun_matches :: MatchGroup idR (LHsExpr idR)
    - fun_co_fn :: HsWrapper
    - bind_fvs :: PostRn idL NameSet
    - fun_tick :: [Tickish Id]
    }
  - | PatBind {
    - pat_lhs :: LPat idL
    - pat_rhs :: GRHSs idR (LHsExpr idR)
    - pat_rhs_ty :: PostTc idR Type
    - bind_fvs :: PostRn idL NameSet
    - pat_ticks :: ([Tickish Id], [[Tickish Id]])
    }
  - | VarBind {
    - var_id :: IdP idL
    - var_rhs :: LHsExpr idR
    - var_inline :: Bool
    }
  - | AbsBinds {
    - abs_tvs :: [TyVar]
    - abs_ev_vars :: [EvVar]
    - abs_exports :: [ABExport idL]
    - abs_ev_binds :: [TcEvBinds]
    - abs_binds :: LHsBinds idL
    - abs_sig :: Bool
    }
  - | PatSynBind (PatSynBind idL idR)
- data ABExport p = ABE {
  - abe_poly :: IdP p
  - abe_mono :: IdP p
  - abe_wrap :: HsWrapper
  - abe_prags :: TcSpecPrags
  }
- data PatSynBind idL idR = PSB {
  - psb_id :: Located (IdP idL)
  - psb_fvs :: PostRn idR NameSet
  - psb_args :: HsPatSynDetails (Located (IdP idR))
  - psb_def :: LPat idR
  - psb_dir :: HsPatSynDir idR
  }
- pprLHsBinds :: (SourceTextX idL, SourceTextX idR, OutputableBndrId idL, OutputableBndrId idR) => LHsBindsLR idL idR -> SDoc
- pprLHsBindsForUser :: (SourceTextX idL, SourceTextX idR, OutputableBndrId idL, OutputableBndrId idR, SourceTextX id2, OutputableBndrId id2) => LHsBindsLR idL idR -> [LSig id2] -> [SDoc]
- pprDeclList :: [SDoc] -> SDoc
- emptyLocalBinds :: HsLocalBindsLR a b
- isEmptyLocalBinds :: HsLocalBindsLR a b -> Bool
- eqEmptyLocalBinds :: HsLocalBindsLR a b -> Bool
- isEmptyValBinds :: HsValBindsLR a b -> Bool
- emptyValBindsIn :: HsValBindsLR a b
- emptyValBindsOut :: HsValBindsLR a b
- emptyLHsBinds :: LHsBindsLR idL idR
- isEmptyLHsBinds :: LHsBindsLR idL idR -> Bool
- plusHsValBinds :: HsValBinds a -> HsValBinds a -> HsValBinds a
- ppr_monobind :: (SourceTextX idL, SourceTextX idR, OutputableBndrId idL, OutputableBndrId idR) => HsBindLR idL idR -> SDoc
- pprTicks :: SDoc -> SDoc -> SDoc
- data HsIPBinds id = IPBinds [LIPBind id] TcEvBinds
- isEmptyIPBinds :: HsIPBinds id -> Bool
- type LIPBind id = Located (IPBind id)
- data IPBind id = IPBind (Either (Located HsIPName) (IdP id)) (LHsExpr id)
- type LSig pass = Located (Sig pass)
- data Sig pass
  - = TypeSig [Located (IdP pass)] (LHsSigWcType pass)
  - | PatSynSig [Located (IdP pass)] (LHsSigType pass)
  - | ClassOpSig Bool [Located (IdP pass)] (LHsSigType pass)
  - | IdSig Id
  - | FixSig (FixitySig pass)
  - | InlineSig (Located (IdP pass)) InlinePragma
  - | SpecSig (Located (IdP pass)) [LHsSigType pass] InlinePragma
  - | SpecInstSig SourceText (LHsSigType pass)
  - | MinimalSig SourceText (LBooleanFormula (Located (IdP pass)))
  - | SCCFunSig SourceText (Located (IdP pass)) (Maybe (Located StringLiteral))
  - | CompleteMatchSig SourceText (Located [Located (IdP pass)]) (Maybe (Located (IdP pass)))
- type LFixitySig pass = Located (FixitySig pass)
- data FixitySig pass = FixitySig [Located (IdP pass)] Fixity
- data TcSpecPrags
  - = IsDefaultMethod
  - | SpecPrags [LTcSpecPrag]
- type LTcSpecPrag = Located TcSpecPrag
- data TcSpecPrag = SpecPrag Id HsWrapper InlinePragma
- noSpecPrags :: TcSpecPrags
- hasSpecPrags :: TcSpecPrags -> Bool
- isDefaultMethod :: TcSpecPrags -> Bool
- isFixityLSig :: LSig name -> Bool
- isTypeLSig :: LSig name -> Bool
- isSpecLSig :: LSig name -> Bool
- isSpecInstLSig :: LSig name -> Bool
- isPragLSig :: LSig name -> Bool
- isInlineLSig :: LSig name -> Bool
- isMinimalLSig :: LSig name -> Bool
- isSCCFunSig :: LSig name -> Bool
- isCompleteMatchSig :: LSig name -> Bool
- hsSigDoc :: Sig name -> SDoc
- ppr_sig :: (SourceTextX pass, OutputableBndrId pass) => Sig pass -> SDoc
- pragBrackets :: SDoc -> SDoc
- pragSrcBrackets :: SourceText -> String -> SDoc -> SDoc
- pprVarSig :: OutputableBndr id => [id] -> SDoc -> SDoc
- pprSpec :: OutputableBndr id => id -> SDoc -> InlinePragma -> SDoc
- pprTcSpecPrags :: TcSpecPrags -> SDoc
- pprMinimalSig :: OutputableBndr name => LBooleanFormula (Located name) -> SDoc
- type HsPatSynDetails arg = HsConDetails arg [RecordPatSynField arg]
- data RecordPatSynField a = RecordPatSynField {
  - recordPatSynSelectorId :: a
  - recordPatSynPatVar :: a
  }
- data HsPatSynDir id
  - = Unidirectional
  - | ImplicitBidirectional
  - | ExplicitBidirectional (MatchGroup id (LHsExpr id))

# Documentation

type HsLocalBinds id = HsLocalBindsLR id id #

Haskell Local Bindings

type LHsLocalBinds id = Located (HsLocalBinds id) #

Located Haskell local bindings

data HsLocalBindsLR idL idR #

Haskell Local Bindings with separate Left and Right identifier types

Bindings in a 'let' expression or a 'where' clause

Constructors

HsValBinds (HsValBindsLR idL idR) | Haskell Value Bindings
HsIPBinds (HsIPBinds idR) | Haskell Implicit Parameter Bindings
EmptyLocalBinds | Empty Local Bindings

Instances

(DataId idL, DataId idR) => Data (HsLocalBindsLR idL idR) # |
Instance details Defined in HsBinds Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> HsLocalBindsLR idL idR -> c (HsLocalBindsLR idL idR) Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (HsLocalBindsLR idL idR) Source # toConstr :: HsLocalBindsLR idL idR -> Constr Source # dataTypeOf :: HsLocalBindsLR idL idR -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (HsLocalBindsLR idL idR)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (HsLocalBindsLR idL idR)) Source # gmapT :: (forall b. Data b => b -> b) -> HsLocalBindsLR idL idR -> HsLocalBindsLR idL idR Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HsLocalBindsLR idL idR -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HsLocalBindsLR idL idR -> r Source # gmapQ :: (forall d. Data d => d -> u) -> HsLocalBindsLR idL idR -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> HsLocalBindsLR idL idR -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> HsLocalBindsLR idL idR -> m (HsLocalBindsLR idL idR) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HsLocalBindsLR idL idR -> m (HsLocalBindsLR idL idR) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HsLocalBindsLR idL idR -> m (HsLocalBindsLR idL idR) Source #
(SourceTextX idL, SourceTextX idR, OutputableBndrId idL, OutputableBndrId idR) => Outputable (HsLocalBindsLR idL idR) # |
Instance details Defined in HsBinds Methods ppr :: HsLocalBindsLR idL idR -> SDoc # pprPrec :: Rational -> HsLocalBindsLR idL idR -> SDoc #

type LHsLocalBindsLR idL idR = Located (HsLocalBindsLR idL idR) #

type HsValBinds id = HsValBindsLR id id #

Haskell Value Bindings

data HsValBindsLR idL idR #

Haskell Value bindings with separate Left and Right identifier types (not implicit parameters) Used for both top level and nested bindings May contain pattern synonym bindings

Constructors

ValBindsIn (LHsBindsLR idL idR) [LSig idR] | Value Bindings In Before renaming RHS; idR is always RdrName Not dependency analysed Recursive by default
ValBindsOut [(RecFlag, LHsBinds idL)] [LSig GhcRn] | Value Bindings Out After renaming RHS; idR can be Name or Id Dependency analysed, later bindings in the list may depend on earlier ones.

Instances

(DataId idL, DataId idR) => Data (HsValBindsLR idL idR) # |
Instance details Defined in HsBinds Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> HsValBindsLR idL idR -> c (HsValBindsLR idL idR) Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (HsValBindsLR idL idR) Source # toConstr :: HsValBindsLR idL idR -> Constr Source # dataTypeOf :: HsValBindsLR idL idR -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (HsValBindsLR idL idR)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (HsValBindsLR idL idR)) Source # gmapT :: (forall b. Data b => b -> b) -> HsValBindsLR idL idR -> HsValBindsLR idL idR Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HsValBindsLR idL idR -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HsValBindsLR idL idR -> r Source # gmapQ :: (forall d. Data d => d -> u) -> HsValBindsLR idL idR -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> HsValBindsLR idL idR -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> HsValBindsLR idL idR -> m (HsValBindsLR idL idR) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HsValBindsLR idL idR -> m (HsValBindsLR idL idR) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HsValBindsLR idL idR -> m (HsValBindsLR idL idR) Source #
(SourceTextX idL, SourceTextX idR, OutputableBndrId idL, OutputableBndrId idR) => Outputable (HsValBindsLR idL idR) # |
Instance details Defined in HsBinds Methods ppr :: HsValBindsLR idL idR -> SDoc # pprPrec :: Rational -> HsValBindsLR idL idR -> SDoc #

type LHsBind id = LHsBindLR id id #

Located Haskell Binding

type LHsBinds id = LHsBindsLR id id #

Located Haskell Bindings

type HsBind id = HsBindLR id id #

Haskell Binding

type LHsBindsLR idL idR = Bag (LHsBindLR idL idR) #

Located Haskell Bindings with separate Left and Right identifier types

type LHsBindLR idL idR = Located (HsBindLR idL idR) #

Located Haskell Binding with separate Left and Right identifier types

data HsBindLR idL idR #

Haskell Binding with separate Left and Right id's

Constructors

FunBind | Function-like Binding FunBind is used for both functions `f x = e` and variables `f = x -> e` and strict variables `!x = x + 1` Reason 1: Special case for type inference: see `tcMonoBinds`. Reason 2: Instance decls can only have FunBinds, which is convenient. If you change this, you'll need to change e.g. rnMethodBinds But note that the form `f :: a->a = ...` parses as a pattern binding, just like `(f :: a -> a) = ...` Strict bindings have their strictness recorded in the `SrcStrictness` of their `MatchContext`. See Note [FunBind vs PatBind] for details about the relationship between FunBind and PatBind. `AnnKeywordId`s `AnnFunId`, attached to each element of fun_matches `AnnEqual`,`AnnWhere`, `AnnOpen`,`AnnClose`,
- Fields fun_id :: Located (IdP idL) fun_matches :: MatchGroup idR (LHsExpr idR) The payload fun_co_fn :: HsWrapper Coercion from the type of the MatchGroup to the type of the Id. Example:
           f :: Int -> forall a. a -> a
           f x y = y
Then the MatchGroup will have type (Int -> a' -> a') (with a free type variable a'). The coercion will take a CoreExpr of this type and convert it to a CoreExpr of type Int -> forall a'. a' -> a' Notice that the coercion captures the free a'. bind_fvs :: PostRn idL NameSet After the renamer, this contains the locally-bound free variables of this defn. See Note [Bind free vars] fun_tick :: [Tickish Id] Ticks to put on the rhs, if any
PatBind | Pattern Binding The pattern is never a simple variable; That case is done by FunBind. See Note [FunBind vs PatBind] for details about the relationship between FunBind and PatBind.
Fields pat_lhs :: LPat idL pat_rhs :: GRHSs idR (LHsExpr idR) pat_rhs_ty :: PostTc idR Type Type of the GRHSs bind_fvs :: PostRn idL NameSet After the renamer, this contains the locally-bound free variables of this defn. See Note [Bind free vars] pat_ticks :: ([Tickish Id], [[Tickish Id]]) Ticks to put on the rhs, if any, and ticks to put on the bound variables.
VarBind | Variable Binding Dictionary binding and suchlike. All VarBinds are introduced by the type checker
Fields var_id :: IdP idL var_rhs :: LHsExpr idR Located only for consistency var_inline :: Bool True = inline this binding regardless (used for implication constraints only)
AbsBinds | Abstraction Bindings
Fields abs_tvs :: [TyVar] abs_ev_vars :: [EvVar] Includes equality constraints abs_exports :: [ABExport idL] 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 TcInstDcls Note [Typechecking plan for instance declarations] abs_binds :: LHsBinds idL Typechecked user bindings abs_sig :: Bool
PatSynBind (PatSynBind idL idR) | `AnnKeywordId` : `AnnPattern`, `AnnLarrow`,`AnnEqual`, `AnnWhere` `AnnOpen` `'{'`,`AnnClose` `'}'`

Instances

(DataId idL, DataId idR) => Data (HsBindLR idL idR) # |
Instance details Defined in HsBinds Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> HsBindLR idL idR -> c (HsBindLR idL idR) Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (HsBindLR idL idR) Source # toConstr :: HsBindLR idL idR -> Constr Source # dataTypeOf :: HsBindLR idL idR -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (HsBindLR idL idR)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (HsBindLR idL idR)) Source # gmapT :: (forall b. Data b => b -> b) -> HsBindLR idL idR -> HsBindLR idL idR Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HsBindLR idL idR -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HsBindLR idL idR -> r Source # gmapQ :: (forall d. Data d => d -> u) -> HsBindLR idL idR -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> HsBindLR idL idR -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> HsBindLR idL idR -> m (HsBindLR idL idR) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HsBindLR idL idR -> m (HsBindLR idL idR) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HsBindLR idL idR -> m (HsBindLR idL idR) Source #
(SourceTextX idL, SourceTextX idR, OutputableBndrId idL, OutputableBndrId idR) => Outputable (HsBindLR idL idR) # |
Instance details Defined in HsBinds Methods ppr :: HsBindLR idL idR -> SDoc # pprPrec :: Rational -> HsBindLR idL idR -> SDoc #

data ABExport p #

Abtraction Bindings Export

Constructors

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

Instances

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

data PatSynBind idL idR #

- `AnnKeywordId` : `AnnPattern`, `AnnEqual`,`AnnLarrow` `AnnWhere`,`AnnOpen` `'{'`, `AnnClose` `'}'`,

Pattern Synonym binding

Constructors

PSB |
Fields psb_id :: Located (IdP idL) Name of the pattern synonym psb_fvs :: PostRn idR NameSet See Note [Bind free vars] psb_args :: HsPatSynDetails (Located (IdP idR)) Formal parameter names psb_def :: LPat idR Right-hand side psb_dir :: HsPatSynDir idR Directionality

Instances

(DataId idL, DataId idR) => Data (PatSynBind idL idR) # |
Instance details Defined in HsBinds Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PatSynBind idL idR -> c (PatSynBind idL idR) Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (PatSynBind idL idR) Source # toConstr :: PatSynBind idL idR -> Constr Source # dataTypeOf :: PatSynBind idL idR -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (PatSynBind idL idR)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (PatSynBind idL idR)) Source # gmapT :: (forall b. Data b => b -> b) -> PatSynBind idL idR -> PatSynBind idL idR Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PatSynBind idL idR -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PatSynBind idL idR -> r Source # gmapQ :: (forall d. Data d => d -> u) -> PatSynBind idL idR -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> PatSynBind idL idR -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> PatSynBind idL idR -> m (PatSynBind idL idR) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PatSynBind idL idR -> m (PatSynBind idL idR) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PatSynBind idL idR -> m (PatSynBind idL idR) Source #
(SourceTextX idR, OutputableBndrId idL, OutputableBndrId idR) => Outputable (PatSynBind idL idR) # |
Instance details Defined in HsBinds Methods ppr :: PatSynBind idL idR -> SDoc # pprPrec :: Rational -> PatSynBind idL idR -> SDoc #

pprLHsBinds :: (SourceTextX idL, SourceTextX idR, OutputableBndrId idL, OutputableBndrId idR) => LHsBindsLR idL idR -> SDoc #

pprLHsBindsForUser :: (SourceTextX idL, SourceTextX idR, OutputableBndrId idL, OutputableBndrId idR, SourceTextX id2, OutputableBndrId id2) => LHsBindsLR idL idR -> [LSig id2] -> [SDoc] #

pprDeclList :: [SDoc] -> SDoc #

emptyLocalBinds :: HsLocalBindsLR a b #

isEmptyLocalBinds :: HsLocalBindsLR a b -> Bool #

eqEmptyLocalBinds :: HsLocalBindsLR a b -> Bool #

isEmptyValBinds :: HsValBindsLR a b -> Bool #

emptyValBindsIn :: HsValBindsLR a b #

emptyValBindsOut :: HsValBindsLR a b #

emptyLHsBinds :: LHsBindsLR idL idR #

isEmptyLHsBinds :: LHsBindsLR idL idR -> Bool #

plusHsValBinds :: HsValBinds a -> HsValBinds a -> HsValBinds a #

ppr_monobind :: (SourceTextX idL, SourceTextX idR, OutputableBndrId idL, OutputableBndrId idR) => HsBindLR idL idR -> SDoc #

pprTicks :: SDoc -> SDoc -> SDoc #

data HsIPBinds id #

Haskell Implicit Parameter Bindings

Constructors

IPBinds [LIPBind id] TcEvBinds |

Instances

DataId id => Data (HsIPBinds id) # |
Instance details Defined in HsBinds Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> HsIPBinds id -> c (HsIPBinds id) Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (HsIPBinds id) Source # toConstr :: HsIPBinds id -> Constr Source # dataTypeOf :: HsIPBinds id -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (HsIPBinds id)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (HsIPBinds id)) Source # gmapT :: (forall b. Data b => b -> b) -> HsIPBinds id -> HsIPBinds id Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HsIPBinds id -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HsIPBinds id -> r Source # gmapQ :: (forall d. Data d => d -> u) -> HsIPBinds id -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> HsIPBinds id -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> HsIPBinds id -> m (HsIPBinds id) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HsIPBinds id -> m (HsIPBinds id) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HsIPBinds id -> m (HsIPBinds id) Source #
(SourceTextX p, OutputableBndrId p) => Outputable (HsIPBinds p) # |
Instance details Defined in HsBinds Methods ppr :: HsIPBinds p -> SDoc # pprPrec :: Rational -> HsIPBinds p -> SDoc #

isEmptyIPBinds :: HsIPBinds id -> Bool #

type LIPBind id = Located (IPBind id) #

Located Implicit Parameter Binding

May have `AnnKeywordId` : `AnnSemi` when in a list

data IPBind id #

Implicit parameter bindings.

These bindings start off as (Left "x") in the parser and stay that way until after type-checking when they are replaced with (Right d), where "d" is the name of the dictionary holding the evidence for the implicit parameter.

- `AnnKeywordId` : `AnnEqual`

Constructors

IPBind (Either (Located HsIPName) (IdP id)) (LHsExpr id) |

Instances

DataId name => Data (IPBind name) # |
Instance details Defined in HsBinds Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> IPBind name -> c (IPBind name) Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (IPBind name) Source # toConstr :: IPBind name -> Constr Source # dataTypeOf :: IPBind name -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (IPBind name)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (IPBind name)) Source # gmapT :: (forall b. Data b => b -> b) -> IPBind name -> IPBind name Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> IPBind name -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> IPBind name -> r Source # gmapQ :: (forall d. Data d => d -> u) -> IPBind name -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> IPBind name -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> IPBind name -> m (IPBind name) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> IPBind name -> m (IPBind name) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> IPBind name -> m (IPBind name) Source #
(SourceTextX p, OutputableBndrId p) => Outputable (IPBind p) # |
Instance details Defined in HsBinds Methods ppr :: IPBind p -> SDoc # pprPrec :: Rational -> IPBind p -> SDoc #

type LSig pass = Located (Sig pass) #

Located Signature

data Sig pass #

Signatures and pragmas

Constructors

TypeSig [Located (IdP pass)] (LHsSigWcType pass) | An ordinary type signature
    f :: Num a => a -> a
After renaming, this list of Names contains the named and unnamed wildcards brought into scope by this signature. For a signature `_ -> _a -> Bool`, the renamer will give the unnamed wildcard `_` a freshly generated name, e.g. `_w`. `_w` and the named wildcard `_a` are then both replaced with fresh meta vars in the type. Their names are stored in the type signature that brought them into scope, in this third field to be more specific. `AnnKeywordId` : `AnnDcolon`, `AnnComma`
PatSynSig [Located (IdP pass)] (LHsSigType pass) | A pattern synonym type signature
    pattern Single :: () => (Show a) => a -> [a]
`AnnKeywordId` : `AnnPattern`, `AnnDcolon`,`AnnForall` `AnnDot`,`AnnDarrow`
ClassOpSig Bool [Located (IdP pass)] (LHsSigType pass) | A signature for a class method False: ordinary class-method signature True: generic-default class method signature e.g. class C a where op :: a -> a -- Ordinary default op :: Eq a => a -> a -- Generic default No wildcards allowed here `AnnKeywordId` : `AnnDefault`, `AnnDcolon`
IdSig Id | 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
FixSig (FixitySig pass) | An ordinary fixity declaration
        infixl 8 ***
`AnnKeywordId` : `AnnInfix`, `AnnVal`
InlineSig (Located (IdP pass)) InlinePragma | An inline pragma
    {#- INLINE f #-}
`AnnKeywordId` : `AnnOpen` `'{-# INLINE'` and `'['`, `AnnClose`,`AnnOpen`, `AnnVal`,`AnnTilde`, `AnnClose`
SpecSig (Located (IdP pass)) [LHsSigType pass] InlinePragma | A specialisation pragma
    {-# SPECIALISE f :: Int -> Int #-}
`AnnKeywordId` : `AnnOpen`, `AnnOpen` `'{-# SPECIALISE'` and `'['`, `AnnTilde`, `AnnVal`, `AnnClose` `']'` and `'#-}'`, `AnnDcolon`
SpecInstSig SourceText (LHsSigType pass) | A specialisation pragma for instance declarations only
    {-# SPECIALISE instance Eq [Int] #-}
(Class tys); should be a specialisation of the current instance declaration `AnnKeywordId` : `AnnOpen`, `AnnInstance`,`AnnClose`
MinimalSig SourceText (LBooleanFormula (Located (IdP pass))) | A minimal complete definition pragma
    {-# MINIMAL a | (b, c | (d | e)) #-}
`AnnKeywordId` : `AnnOpen`, `AnnVbar`,`AnnComma`, `AnnClose`
SCCFunSig SourceText (Located (IdP pass)) (Maybe (Located StringLiteral)) | A "set cost centre" pragma for declarations
    {-# SCC funName #-}
or
    {-# SCC funName "cost_centre_name" #-}
CompleteMatchSig SourceText (Located [Located (IdP pass)]) (Maybe (Located (IdP pass))) | A complete match pragma
    {-# COMPLETE C, D [:: T] #-}
Used to inform the pattern match checker about additional complete matchings which, for example, arise from pattern synonym definitions.

Instances

DataId pass => Data (Sig pass) # |
Instance details Defined in HsBinds Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Sig pass -> c (Sig pass) Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Sig pass) Source # toConstr :: Sig pass -> Constr Source # dataTypeOf :: Sig pass -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Sig pass)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Sig pass)) Source # gmapT :: (forall b. Data b => b -> b) -> Sig pass -> Sig pass Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Sig pass -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Sig pass -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Sig pass -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Sig pass -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Sig pass -> m (Sig pass) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Sig pass -> m (Sig pass) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Sig pass -> m (Sig pass) Source #
(SourceTextX pass, OutputableBndrId pass) => Outputable (Sig pass) # |
Instance details Defined in HsBinds Methods ppr :: Sig pass -> SDoc # pprPrec :: Rational -> Sig pass -> SDoc #

type LFixitySig pass = Located (FixitySig pass) #

Located Fixity Signature

data FixitySig pass #

Fixity Signature

Constructors

FixitySig [Located (IdP pass)] Fixity |

Instances

DataId pass => Data (FixitySig pass) # |
Instance details Defined in HsBinds Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FixitySig pass -> c (FixitySig pass) Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (FixitySig pass) Source # toConstr :: FixitySig pass -> Constr Source # dataTypeOf :: FixitySig pass -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (FixitySig pass)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (FixitySig pass)) Source # gmapT :: (forall b. Data b => b -> b) -> FixitySig pass -> FixitySig pass Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FixitySig pass -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FixitySig pass -> r Source # gmapQ :: (forall d. Data d => d -> u) -> FixitySig pass -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> FixitySig pass -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> FixitySig pass -> m (FixitySig pass) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FixitySig pass -> m (FixitySig pass) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FixitySig pass -> m (FixitySig pass) Source #
OutputableBndrId pass => Outputable (FixitySig pass) # |
Instance details Defined in HsBinds Methods ppr :: FixitySig pass -> SDoc # pprPrec :: Rational -> FixitySig pass -> 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

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

type LTcSpecPrag = Located TcSpecPrag #

Located Type checker Specification Pragmas

data TcSpecPrag #

Type checker Specification Pragma

Constructors

SpecPrag Id HsWrapper InlinePragma | The Id to be specialised, a wrapper that specialises the polymorphic function, and inlining spec for the specialised function

Instances

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

noSpecPrags :: TcSpecPrags #

hasSpecPrags :: TcSpecPrags -> Bool #

isDefaultMethod :: TcSpecPrags -> Bool #

isFixityLSig :: LSig name -> Bool #

isTypeLSig :: LSig name -> Bool #

isSpecLSig :: LSig name -> Bool #

isSpecInstLSig :: LSig name -> Bool #

isPragLSig :: LSig name -> Bool #

isInlineLSig :: LSig name -> Bool #

isMinimalLSig :: LSig name -> Bool #

isSCCFunSig :: LSig name -> Bool #

isCompleteMatchSig :: LSig name -> Bool #

hsSigDoc :: Sig name -> SDoc #

ppr_sig :: (SourceTextX pass, OutputableBndrId pass) => Sig pass -> SDoc #

pragBrackets :: SDoc -> SDoc #

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

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

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

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

pprTcSpecPrags :: TcSpecPrags -> SDoc #

pprMinimalSig :: OutputableBndr name => LBooleanFormula (Located name) -> SDoc #

type HsPatSynDetails arg = HsConDetails arg [RecordPatSynField arg] #

Haskell Pattern Synonym Details

data RecordPatSynField a #

Record Pattern Synonym Field

Constructors

RecordPatSynField |
Fields recordPatSynSelectorId :: a recordPatSynPatVar :: a

Instances

Functor RecordPatSynField # |
Instance details Defined in HsBinds Methods fmap :: (a -> b) -> RecordPatSynField a -> RecordPatSynField b Source # (<$) :: a -> RecordPatSynField b -> RecordPatSynField a Source #
Foldable RecordPatSynField # |
Instance details Defined in HsBinds Methods fold :: Monoid m => RecordPatSynField m -> m Source # foldMap :: Monoid m => (a -> m) -> RecordPatSynField a -> m Source # foldr :: (a -> b -> b) -> b -> RecordPatSynField a -> b Source # foldr' :: (a -> b -> b) -> b -> RecordPatSynField a -> b Source # foldl :: (b -> a -> b) -> b -> RecordPatSynField a -> b Source # foldl' :: (b -> a -> b) -> b -> RecordPatSynField a -> b Source # foldr1 :: (a -> a -> a) -> RecordPatSynField a -> a Source # foldl1 :: (a -> a -> a) -> RecordPatSynField a -> a Source # toList :: RecordPatSynField a -> [a] Source # null :: RecordPatSynField a -> Bool Source # length :: RecordPatSynField a -> Int Source # elem :: Eq a => a -> RecordPatSynField a -> Bool Source # maximum :: Ord a => RecordPatSynField a -> a Source # minimum :: Ord a => RecordPatSynField a -> a Source # sum :: Num a => RecordPatSynField a -> a Source # product :: Num a => RecordPatSynField a -> a Source #
Traversable RecordPatSynField # |
Instance details Defined in HsBinds Methods traverse :: Applicative f => (a -> f b) -> RecordPatSynField a -> f (RecordPatSynField b) Source # sequenceA :: Applicative f => RecordPatSynField (f a) -> f (RecordPatSynField a) Source # mapM :: Monad m => (a -> m b) -> RecordPatSynField a -> m (RecordPatSynField b) Source # sequence :: Monad m => RecordPatSynField (m a) -> m (RecordPatSynField a) Source #
Data a => Data (RecordPatSynField a) # |
Instance details Defined in HsBinds Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> RecordPatSynField a -> c (RecordPatSynField a) Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (RecordPatSynField a) Source # toConstr :: RecordPatSynField a -> Constr Source # dataTypeOf :: RecordPatSynField a -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (RecordPatSynField a)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (RecordPatSynField a)) Source # gmapT :: (forall b. Data b => b -> b) -> RecordPatSynField a -> RecordPatSynField a Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RecordPatSynField a -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RecordPatSynField a -> r Source # gmapQ :: (forall d. Data d => d -> u) -> RecordPatSynField a -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> RecordPatSynField a -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> RecordPatSynField a -> m (RecordPatSynField a) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RecordPatSynField a -> m (RecordPatSynField a) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RecordPatSynField a -> m (RecordPatSynField a) Source #
Outputable a => Outputable (RecordPatSynField a) # |
Instance details Defined in HsBinds Methods ppr :: RecordPatSynField a -> SDoc # pprPrec :: Rational -> RecordPatSynField a -> SDoc #

data HsPatSynDir id #

Haskell Pattern Synonym Direction

Constructors

Unidirectional |
ImplicitBidirectional |
ExplicitBidirectional (MatchGroup id (LHsExpr id)) |

Instances

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