GHC.Hs.Pat

ghc-9.10.0.20240328: The GHC API

Safe Haskell | None
Language | GHC2021

GHC.Hs.Pat

Contents

- Orphan instances

Synopsis

- data Pat p
  - = WildPat (XWildPat p)
  - | VarPat (XVarPat p) (LIdP p)
  - | LazyPat (XLazyPat p) (LPat p)
  - | AsPat (XAsPat p) (LIdP p) (LPat p)
  - | ParPat (XParPat p) (LPat p)
  - | BangPat (XBangPat p) (LPat p)
  - | ListPat (XListPat p) [LPat p]
  - | TuplePat (XTuplePat p) [LPat p] Boxity
  - | SumPat (XSumPat p) (LPat p) ConTag SumWidth
  - | ConPat {
    - pat_con_ext :: XConPat p
    - pat_con :: XRec p (ConLikeP p)
    - pat_args :: HsConPatDetails p
    }
  - | ViewPat (XViewPat p) (LHsExpr p) (LPat p)
  - | SplicePat (XSplicePat p) (HsUntypedSplice p)
  - | LitPat (XLitPat p) (HsLit p)
  - | NPat (XNPat p) (XRec p (HsOverLit p)) (Maybe (SyntaxExpr p)) (SyntaxExpr p)
  - | NPlusKPat (XNPlusKPat p) (LIdP p) (XRec p (HsOverLit p)) (HsOverLit p) (SyntaxExpr p) (SyntaxExpr p)
  - | SigPat (XSigPat p) (LPat p) (HsPatSigType (NoGhcTc p))
  - | EmbTyPat (XEmbTyPat p) (HsTyPat (NoGhcTc p))
  - | XPat !(XXPat p)
- type LPat p = XRec p (Pat p)
- data ArgPat pass
  - = VisPat (XVisPat pass) (LPat pass)
  - | InvisPat (XInvisPat pass) (HsTyPat (NoGhcTc pass))
  - | XArgPat !(XXArgPat pass)
- type LArgPat pass = XRec pass (ArgPat pass)
- isInvisArgPat :: ArgPat p -> Bool
- isVisArgPat :: ArgPat pass -> Bool
- mapVisPat :: (LPat pass -> LPat pass) -> ArgPat pass -> ArgPat pass
- data EpAnnSumPat = EpAnnSumPat {
  - sumPatParens :: [AddEpAnn]
  - sumPatVbarsBefore :: [EpaLocation]
  - sumPatVbarsAfter :: [EpaLocation]
  }
- data ConPatTc = ConPatTc {
  - cpt_arg_tys :: [Type]
  - cpt_tvs :: [TyVar]
  - cpt_dicts :: [EvVar]
  - cpt_binds :: TcEvBinds
  - cpt_wrap :: HsWrapper
  }
- type family ConLikeP x
- data HsPatExpansion a b = HsPatExpanded a b
- data XXPatGhcTc
  - = CoPat {
    - co_cpt_wrap :: HsWrapper
    - co_pat_inner :: Pat GhcTc
    - co_pat_ty :: Type
    }
  - | ExpansionPat (Pat GhcRn) (Pat GhcTc)
- type HsConPatDetails p = HsConDetails (HsConPatTyArg (NoGhcTc p)) (LPat p) (HsRecFields p (LPat p))
- hsConPatArgs :: UnXRec p => HsConPatDetails p -> [LPat p]
- hsConPatTyArgs :: HsConPatDetails p -> [HsConPatTyArg (NoGhcTc p)]
- data HsConPatTyArg p = HsConPatTyArg !(XConPatTyArg p) (HsTyPat p)
- data HsRecFields p arg = HsRecFields {
  - rec_flds :: [LHsRecField p arg]
  - rec_dotdot :: Maybe (XRec p RecFieldsDotDot)
  }
- data HsFieldBind lhs rhs = HsFieldBind {
  - hfbAnn :: XHsFieldBind lhs
  - hfbLHS :: lhs
  - hfbRHS :: rhs
  - hfbPun :: Bool
  }
- type LHsFieldBind p id arg = XRec p (HsFieldBind id arg)
- type HsRecField p arg = HsFieldBind (LFieldOcc p) arg
- type LHsRecField p arg = XRec p (HsRecField p arg)
- type HsRecUpdField p q = HsFieldBind (LAmbiguousFieldOcc p) (LHsExpr q)
- type LHsRecUpdField p q = XRec p (HsRecUpdField p q)
- newtype RecFieldsDotDot = RecFieldsDotDot {
  - unRecFieldsDotDot :: Int
  }
- hsRecFields :: UnXRec p => HsRecFields p arg -> [XCFieldOcc p]
- hsRecFieldSel :: UnXRec p => HsRecField p arg -> XCFieldOcc p
- hsRecFieldId :: HsRecField GhcTc arg -> Id
- hsRecFieldsArgs :: UnXRec p => HsRecFields p arg -> [arg]
- hsRecUpdFieldId :: HsFieldBind (LAmbiguousFieldOcc GhcTc) arg -> Located Id
- hsRecUpdFieldOcc :: HsFieldBind (LAmbiguousFieldOcc GhcTc) arg -> LFieldOcc GhcTc
- hsRecUpdFieldRdr :: forall (p :: Pass) q. HsRecUpdField (GhcPass p) q -> Located RdrName
- mkPrefixConPat :: DataCon -> [LPat GhcTc] -> [Type] -> LPat GhcTc
- mkCharLitPat :: SourceText -> Char -> LPat GhcTc
- mkNilPat :: Type -> LPat GhcTc
- mkVisPat :: forall (pass :: Pass). XVisPat (GhcPass pass) ~ NoExtField => LPat (GhcPass pass) -> LArgPat (GhcPass pass)
- mkVisPatX :: forall (pass :: Pass). XVisPat (GhcPass pass) -> LPat (GhcPass pass) -> LArgPat (GhcPass pass)
- mkRetainedVisPat :: forall (pass :: Pass). IsPass pass => LPat (GhcPass pass) -> LArgPat (GhcPass pass)
- data Erasure
  - = Erased
  - | Retained
- isSimplePat :: forall (x :: Pass). LPat (GhcPass x) -> Maybe (IdP (GhcPass x))
- isPatSyn :: LPat GhcTc -> Bool
- looksLazyPatBind :: HsBind GhcTc -> Bool
- isBangedLPat :: forall (p :: Pass). LPat (GhcPass p) -> Bool
- gParPat :: forall (p :: Pass). IsPass p => LPat (GhcPass p) -> Pat (GhcPass p)
- patNeedsParens :: forall (p :: Pass). IsPass p => PprPrec -> Pat (GhcPass p) -> Bool
- parenthesizePat :: forall (p :: Pass). IsPass p => PprPrec -> LPat (GhcPass p) -> LPat (GhcPass p)
- parenthesizeLArgPat :: forall (p :: Pass). IsPass p => PprPrec -> LArgPat (GhcPass p) -> LArgPat (GhcPass p)
- isIrrefutableHsPatHelper :: forall (p :: Pass). OutputableBndrId p => Bool -> LPat (GhcPass p) -> Bool
- isIrrefutableHsPatHelperM :: forall m (p :: Pass). (Monad m, OutputableBndrId p) => LPatIrrefutableCheck m (GhcPass p)
- isBoringHsPat :: forall (p :: Pass). OutputableBndrId p => LPat (GhcPass p) -> Bool
- collectEvVarsPat :: Pat GhcTc -> Bag EvVar
- collectEvVarsPats :: [Pat GhcTc] -> Bag EvVar
- pprParendLArgPat :: forall (p :: Pass). OutputableBndrId p => PprPrec -> LArgPat (GhcPass p) -> SDoc
- pprParendLPat :: forall (p :: Pass). OutputableBndrId p => PprPrec -> LPat (GhcPass p) -> SDoc
- pprConArgs :: forall (p :: Pass). (OutputableBndrId p, Outputable (Anno (IdGhcP p))) => HsConPatDetails (GhcPass p) -> SDoc
- pprLPat :: forall (p :: Pass). OutputableBndrId p => LPat (GhcPass p) -> SDoc

# Documentation

data Pat p Source #

Pattern

- `AnnKeywordId` : `AnnBang`

Constructors

WildPat (XWildPat p) | Wildcard Pattern The sole reason for a type on a WildPat is to support hsPatType :: Pat Id -> Type
VarPat (XVarPat p) (LIdP p) | Variable Pattern
LazyPat (XLazyPat p) (LPat p) | Lazy Pattern ^ - `AnnKeywordId` : `AnnTilde`
AsPat (XAsPat p) (LIdP p) (LPat p) | As pattern ^ - `AnnKeywordId` : `AnnAt`
ParPat (XParPat p) (LPat p) | Parenthesised pattern See Note [Parens in HsSyn] in GHC.Hs.Expr ^ - `AnnKeywordId` : `AnnOpen` `'('`, `AnnClose` `')'`
BangPat (XBangPat p) (LPat p) | Bang pattern ^ - `AnnKeywordId` : `AnnBang`
ListPat (XListPat p) [LPat p] | Syntactic List `AnnKeywordId` : `AnnOpen` `'['`, `AnnClose` `']'`
TuplePat (XTuplePat p) [LPat p] Boxity | Tuple sub-patterns `AnnKeywordId` : `AnnOpen` `'('` or `'(#'`, `AnnClose` `')'` or `'#)'`
SumPat (XSumPat p) (LPat p) ConTag SumWidth | Anonymous sum pattern `AnnKeywordId` : `AnnOpen` `'(#'`, `AnnClose` `'#)'`
ConPat | Constructor Pattern
Fields pat_con_ext :: XConPat p pat_con :: XRec p (ConLikeP p) pat_args :: HsConPatDetails p
ViewPat | `AnnKeywordId` : `AnnRarrow`
Fields (XViewPat p) (LHsExpr p) (LPat p) View Pattern
SplicePat | `AnnKeywordId` : `AnnOpen` `'$('` `AnnClose` `')'`
Fields (XSplicePat p) (HsUntypedSplice p) Splice Pattern (Includes quasi-quotes)
LitPat (XLitPat p) (HsLit p) | Literal Pattern Used for *non-overloaded* literal patterns: Int#, Char#, Int, Char, String, etc.
NPat (XNPat p) (XRec p (HsOverLit p)) (Maybe (SyntaxExpr p)) (SyntaxExpr p) | Natural Pattern `AnnKeywordId` : `AnnVal` ``+``
NPlusKPat (XNPlusKPat p) (LIdP p) (XRec p (HsOverLit p)) (HsOverLit p) (SyntaxExpr p) (SyntaxExpr p) | n+k pattern
SigPat | `AnnKeywordId` : `AnnDcolon`
Fields (XSigPat p) (LPat p) (HsPatSigType (NoGhcTc p)) Pattern with a type signature
EmbTyPat (XEmbTyPat p) (HsTyPat (NoGhcTc p)) |
XPat !(XXPat p) |

#### Instances

Instances details

OutputableBndrId p => Outputable (Pat (GhcPass p)) Source # |
Instance details Defined in GHC.Hs.Pat Methods ppr :: Pat (GhcPass p) -> SDoc Source #
Data (Pat GhcPs) Source # |
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) -> Pat GhcPs -> c (Pat GhcPs) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Pat GhcPs) # toConstr :: Pat GhcPs -> Constr # dataTypeOf :: Pat GhcPs -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Pat GhcPs)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Pat GhcPs)) # gmapT :: (forall b. Data b => b -> b) -> Pat GhcPs -> Pat GhcPs # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Pat GhcPs -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Pat GhcPs -> r # gmapQ :: (forall d. Data d => d -> u) -> Pat GhcPs -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Pat GhcPs -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Pat GhcPs -> m (Pat GhcPs) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Pat GhcPs -> m (Pat GhcPs) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Pat GhcPs -> m (Pat GhcPs) #
Data (Pat GhcRn) Source # |
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) -> Pat GhcRn -> c (Pat GhcRn) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Pat GhcRn) # toConstr :: Pat GhcRn -> Constr # dataTypeOf :: Pat GhcRn -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Pat GhcRn)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Pat GhcRn)) # gmapT :: (forall b. Data b => b -> b) -> Pat GhcRn -> Pat GhcRn # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Pat GhcRn -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Pat GhcRn -> r # gmapQ :: (forall d. Data d => d -> u) -> Pat GhcRn -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Pat GhcRn -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Pat GhcRn -> m (Pat GhcRn) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Pat GhcRn -> m (Pat GhcRn) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Pat GhcRn -> m (Pat GhcRn) #
Data (Pat GhcTc) Source # |
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) -> Pat GhcTc -> c (Pat GhcTc) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Pat GhcTc) # toConstr :: Pat GhcTc -> Constr # dataTypeOf :: Pat GhcTc -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Pat GhcTc)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Pat GhcTc)) # gmapT :: (forall b. Data b => b -> b) -> Pat GhcTc -> Pat GhcTc # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Pat GhcTc -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Pat GhcTc -> r # gmapQ :: (forall d. Data d => d -> u) -> Pat GhcTc -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Pat GhcTc -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Pat GhcTc -> m (Pat GhcTc) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Pat GhcTc -> m (Pat GhcTc) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Pat GhcTc -> m (Pat GhcTc) #
type Anno (Pat (GhcPass p)) Source # |
Instance details Defined in GHC.Hs.Pat type Anno (Pat (GhcPass p)) = SrcSpanAnnA

type LPat p = XRec p (Pat p) Source #

data ArgPat pass Source #

A pattern to be used in a sequence of patterns, like what appears to the right of `f` in `f a b True = ...`. A `ArgPat` allows for the possibility of binding a type variable with @.

Constructors

VisPat (XVisPat pass) (LPat pass) |
InvisPat (XInvisPat pass) (HsTyPat (NoGhcTc pass)) |
XArgPat !(XXArgPat pass) |

#### Instances

Instances details

OutputableBndrId p => Outputable (ArgPat (GhcPass p)) Source # |
Instance details Defined in GHC.Hs.Pat Methods ppr :: ArgPat (GhcPass p) -> SDoc Source #
Data (ArgPat GhcPs) Source # |
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) -> ArgPat GhcPs -> c (ArgPat GhcPs) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ArgPat GhcPs) # toConstr :: ArgPat GhcPs -> Constr # dataTypeOf :: ArgPat GhcPs -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (ArgPat GhcPs)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ArgPat GhcPs)) # gmapT :: (forall b. Data b => b -> b) -> ArgPat GhcPs -> ArgPat GhcPs # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ArgPat GhcPs -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ArgPat GhcPs -> r # gmapQ :: (forall d. Data d => d -> u) -> ArgPat GhcPs -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ArgPat GhcPs -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ArgPat GhcPs -> m (ArgPat GhcPs) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ArgPat GhcPs -> m (ArgPat GhcPs) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ArgPat GhcPs -> m (ArgPat GhcPs) #
Data (ArgPat GhcRn) Source # |
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) -> ArgPat GhcRn -> c (ArgPat GhcRn) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ArgPat GhcRn) # toConstr :: ArgPat GhcRn -> Constr # dataTypeOf :: ArgPat GhcRn -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (ArgPat GhcRn)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ArgPat GhcRn)) # gmapT :: (forall b. Data b => b -> b) -> ArgPat GhcRn -> ArgPat GhcRn # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ArgPat GhcRn -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ArgPat GhcRn -> r # gmapQ :: (forall d. Data d => d -> u) -> ArgPat GhcRn -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ArgPat GhcRn -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ArgPat GhcRn -> m (ArgPat GhcRn) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ArgPat GhcRn -> m (ArgPat GhcRn) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ArgPat GhcRn -> m (ArgPat GhcRn) #
Data (ArgPat GhcTc) Source # |
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) -> ArgPat GhcTc -> c (ArgPat GhcTc) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ArgPat GhcTc) # toConstr :: ArgPat GhcTc -> Constr # dataTypeOf :: ArgPat GhcTc -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (ArgPat GhcTc)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ArgPat GhcTc)) # gmapT :: (forall b. Data b => b -> b) -> ArgPat GhcTc -> ArgPat GhcTc # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ArgPat GhcTc -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ArgPat GhcTc -> r # gmapQ :: (forall d. Data d => d -> u) -> ArgPat GhcTc -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ArgPat GhcTc -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ArgPat GhcTc -> m (ArgPat GhcTc) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ArgPat GhcTc -> m (ArgPat GhcTc) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ArgPat GhcTc -> m (ArgPat GhcTc) #
type Anno (ArgPat (GhcPass p)) Source # |
Instance details Defined in GHC.Hs.Pat type Anno (ArgPat (GhcPass p)) = SrcSpanAnnA

type LArgPat pass = XRec pass (ArgPat pass) Source #

isInvisArgPat :: ArgPat p -> Bool Source #

isVisArgPat :: ArgPat pass -> Bool Source #

mapVisPat :: (LPat pass -> LPat pass) -> ArgPat pass -> ArgPat pass Source #

data EpAnnSumPat Source #

Constructors

EpAnnSumPat |
Fields sumPatParens :: [AddEpAnn] sumPatVbarsBefore :: [EpaLocation] sumPatVbarsAfter :: [EpaLocation]

#### Instances

Instances details

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

data ConPatTc Source #

This is the extension field for ConPat, added after typechecking It adds quite a few extra fields, to support elaboration of pattern matching.

Constructors

ConPatTc |
Fields cpt_arg_tys :: [Type] The universal arg types 1-1 with the universal tyvars of the constructor/pattern synonym Use (conLikeResTy pat_con cpt_arg_tys) to get the type of the pattern cpt_tvs :: [TyVar] Existentially bound type variables in correctly-scoped order e.g. [k:* x:k] cpt_dicts :: [EvVar] Ditto *coercion variables* and *dictionaries* One reason for putting coercion variable here I think is to ensure their kinds are zonked cpt_binds :: TcEvBinds Bindings involving those dictionaries cpt_wrap :: HsWrapper Extra wrapper to pass to the matcher Only relevant for pattern-synonyms; ignored for data cons

#### Instances

Instances details

Data ConPatTc Source # |
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) -> ConPatTc -> c ConPatTc # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ConPatTc # toConstr :: ConPatTc -> Constr # dataTypeOf :: ConPatTc -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ConPatTc) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ConPatTc) # gmapT :: (forall b. Data b => b -> b) -> ConPatTc -> ConPatTc # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ConPatTc -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ConPatTc -> r # gmapQ :: (forall d. Data d => d -> u) -> ConPatTc -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ConPatTc -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ConPatTc -> m ConPatTc # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ConPatTc -> m ConPatTc # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ConPatTc -> m ConPatTc #

type family ConLikeP x Source #

#### Instances

Instances details

type ConLikeP GhcPs Source # |
Instance details Defined in GHC.Hs.Pat type ConLikeP GhcPs = RdrName
type ConLikeP GhcRn Source # |
Instance details Defined in GHC.Hs.Pat type ConLikeP GhcRn = Name
type ConLikeP GhcTc Source # |
Instance details Defined in GHC.Hs.Pat type ConLikeP GhcTc = ConLike

data HsPatExpansion a b Source #

Constructors

HsPatExpanded a b |

#### Instances

Instances details

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

data XXPatGhcTc Source #

Extension constructor for Pat, added after typechecking.

Constructors

CoPat | Coercion Pattern (translation only) During desugaring a (CoPat co pat) turns into a cast with `co` on the scrutinee, followed by a match on `pat`.
Fields co_cpt_wrap :: HsWrapper Coercion Pattern If co :: t1 ~ t2, p :: t2, then (CoPat co p) :: t1 co_pat_inner :: Pat GhcTc Why not LPat? Ans: existing locn will do co_pat_ty :: Type Type of whole pattern, t1
ExpansionPat (Pat GhcRn) (Pat GhcTc) | Pattern expansion: original pattern, and desugared pattern, for RebindableSyntax and other overloaded syntax such as OverloadedLists. See Note [Rebindable syntax and XXExprGhcRn].

#### Instances

Instances details

Data XXPatGhcTc Source # |
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) -> XXPatGhcTc -> c XXPatGhcTc # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c XXPatGhcTc # toConstr :: XXPatGhcTc -> Constr # dataTypeOf :: XXPatGhcTc -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c XXPatGhcTc) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c XXPatGhcTc) # gmapT :: (forall b. Data b => b -> b) -> XXPatGhcTc -> XXPatGhcTc # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> XXPatGhcTc -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> XXPatGhcTc -> r # gmapQ :: (forall d. Data d => d -> u) -> XXPatGhcTc -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> XXPatGhcTc -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> XXPatGhcTc -> m XXPatGhcTc # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> XXPatGhcTc -> m XXPatGhcTc # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> XXPatGhcTc -> m XXPatGhcTc #

type HsConPatDetails p = HsConDetails (HsConPatTyArg (NoGhcTc p)) (LPat p) (HsRecFields p (LPat p)) Source #

Haskell Constructor Pattern Details

hsConPatArgs :: UnXRec p => HsConPatDetails p -> [LPat p] Source #

hsConPatTyArgs :: HsConPatDetails p -> [HsConPatTyArg (NoGhcTc p)] Source #

data HsConPatTyArg p Source #

Type argument in a data constructor pattern, e.g. the `@a` in `f (Just @a x) = ...`.

Constructors

HsConPatTyArg !(XConPatTyArg p) (HsTyPat p) |

#### Instances

Instances details

Outputable (HsTyPat p) => Outputable (HsConPatTyArg p) Source # |
Instance details Defined in GHC.Hs.Pat Methods ppr :: HsConPatTyArg p -> SDoc Source #
Data (HsConPatTyArg GhcPs) Source # |
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) -> HsConPatTyArg GhcPs -> c (HsConPatTyArg GhcPs) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (HsConPatTyArg GhcPs) # toConstr :: HsConPatTyArg GhcPs -> Constr # dataTypeOf :: HsConPatTyArg GhcPs -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (HsConPatTyArg GhcPs)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (HsConPatTyArg GhcPs)) # gmapT :: (forall b. Data b => b -> b) -> HsConPatTyArg GhcPs -> HsConPatTyArg GhcPs # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HsConPatTyArg GhcPs -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HsConPatTyArg GhcPs -> r # gmapQ :: (forall d. Data d => d -> u) -> HsConPatTyArg GhcPs -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> HsConPatTyArg GhcPs -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> HsConPatTyArg GhcPs -> m (HsConPatTyArg GhcPs) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HsConPatTyArg GhcPs -> m (HsConPatTyArg GhcPs) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HsConPatTyArg GhcPs -> m (HsConPatTyArg GhcPs) #
Data (HsConPatTyArg GhcRn) Source # |
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) -> HsConPatTyArg GhcRn -> c (HsConPatTyArg GhcRn) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (HsConPatTyArg GhcRn) # toConstr :: HsConPatTyArg GhcRn -> Constr # dataTypeOf :: HsConPatTyArg GhcRn -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (HsConPatTyArg GhcRn)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (HsConPatTyArg GhcRn)) # gmapT :: (forall b. Data b => b -> b) -> HsConPatTyArg GhcRn -> HsConPatTyArg GhcRn # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HsConPatTyArg GhcRn -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HsConPatTyArg GhcRn -> r # gmapQ :: (forall d. Data d => d -> u) -> HsConPatTyArg GhcRn -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> HsConPatTyArg GhcRn -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> HsConPatTyArg GhcRn -> m (HsConPatTyArg GhcRn) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HsConPatTyArg GhcRn -> m (HsConPatTyArg GhcRn) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HsConPatTyArg GhcRn -> m (HsConPatTyArg GhcRn) #
Data (HsConPatTyArg GhcTc) Source # |
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) -> HsConPatTyArg GhcTc -> c (HsConPatTyArg GhcTc) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (HsConPatTyArg GhcTc) # toConstr :: HsConPatTyArg GhcTc -> Constr # dataTypeOf :: HsConPatTyArg GhcTc -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (HsConPatTyArg GhcTc)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (HsConPatTyArg GhcTc)) # gmapT :: (forall b. Data b => b -> b) -> HsConPatTyArg GhcTc -> HsConPatTyArg GhcTc # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HsConPatTyArg GhcTc -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HsConPatTyArg GhcTc -> r # gmapQ :: (forall d. Data d => d -> u) -> HsConPatTyArg GhcTc -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> HsConPatTyArg GhcTc -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> HsConPatTyArg GhcTc -> m (HsConPatTyArg GhcTc) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HsConPatTyArg GhcTc -> m (HsConPatTyArg GhcTc) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HsConPatTyArg GhcTc -> m (HsConPatTyArg GhcTc) #

data HsRecFields p arg Source #

Haskell Record Fields

HsRecFields is used only for patterns and expressions (not data type declarations)

Constructors

HsRecFields |
Fields rec_flds :: [LHsRecField p arg] rec_dotdot :: Maybe (XRec p RecFieldsDotDot)

#### Instances

Instances details

(Outputable arg, Outputable (XRec p (HsRecField p arg)), XRec p RecFieldsDotDot ~ Located RecFieldsDotDot) => Outputable (HsRecFields p arg) Source # |
Instance details Defined in GHC.Hs.Pat Methods ppr :: HsRecFields p arg -> SDoc Source #
Data body => Data (HsRecFields GhcPs body) Source # |
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) -> HsRecFields GhcPs body -> c (HsRecFields GhcPs body) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (HsRecFields GhcPs body) # toConstr :: HsRecFields GhcPs body -> Constr # dataTypeOf :: HsRecFields GhcPs body -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (HsRecFields GhcPs body)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (HsRecFields GhcPs body)) # gmapT :: (forall b. Data b => b -> b) -> HsRecFields GhcPs body -> HsRecFields GhcPs body # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HsRecFields GhcPs body -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HsRecFields GhcPs body -> r # gmapQ :: (forall d. Data d => d -> u) -> HsRecFields GhcPs body -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> HsRecFields GhcPs body -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> HsRecFields GhcPs body -> m (HsRecFields GhcPs body) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HsRecFields GhcPs body -> m (HsRecFields GhcPs body) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HsRecFields GhcPs body -> m (HsRecFields GhcPs body) #
Data body => Data (HsRecFields GhcRn body) Source # |
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) -> HsRecFields GhcRn body -> c (HsRecFields GhcRn body) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (HsRecFields GhcRn body) # toConstr :: HsRecFields GhcRn body -> Constr # dataTypeOf :: HsRecFields GhcRn body -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (HsRecFields GhcRn body)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (HsRecFields GhcRn body)) # gmapT :: (forall b. Data b => b -> b) -> HsRecFields GhcRn body -> HsRecFields GhcRn body # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HsRecFields GhcRn body -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HsRecFields GhcRn body -> r # gmapQ :: (forall d. Data d => d -> u) -> HsRecFields GhcRn body -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> HsRecFields GhcRn body -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> HsRecFields GhcRn body -> m (HsRecFields GhcRn body) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HsRecFields GhcRn body -> m (HsRecFields GhcRn body) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HsRecFields GhcRn body -> m (HsRecFields GhcRn body) #
Data body => Data (HsRecFields GhcTc body) Source # |
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) -> HsRecFields GhcTc body -> c (HsRecFields GhcTc body) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (HsRecFields GhcTc body) # toConstr :: HsRecFields GhcTc body -> Constr # dataTypeOf :: HsRecFields GhcTc body -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (HsRecFields GhcTc body)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (HsRecFields GhcTc body)) # gmapT :: (forall b. Data b => b -> b) -> HsRecFields GhcTc body -> HsRecFields GhcTc body # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HsRecFields GhcTc body -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HsRecFields GhcTc body -> r # gmapQ :: (forall d. Data d => d -> u) -> HsRecFields GhcTc body -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> HsRecFields GhcTc body -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> HsRecFields GhcTc body -> m (HsRecFields GhcTc body) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HsRecFields GhcTc body -> m (HsRecFields GhcTc body) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HsRecFields GhcTc body -> m (HsRecFields GhcTc body) #

data HsFieldBind lhs rhs Source #

Haskell Field Binding

- `AnnKeywordId` : `AnnEqual`,

For details on above see Note [exact print annotations] in GHC.Parser.Annotation

Constructors

HsFieldBind |
Fields hfbAnn :: XHsFieldBind lhs hfbLHS :: lhs hfbRHS :: rhs Filled in by renamer when punning hfbPun :: Bool Note [Punning]

#### Instances

Instances details

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

type LHsFieldBind p id arg = XRec p (HsFieldBind id arg) Source #

Located Haskell Record Field

type HsRecField p arg = HsFieldBind (LFieldOcc p) arg Source #

Haskell Record Field

type LHsRecField p arg = XRec p (HsRecField p arg) Source #

Located Haskell Record Field

type HsRecUpdField p q = HsFieldBind (LAmbiguousFieldOcc p) (LHsExpr q) Source #

Haskell Record Update Field

type LHsRecUpdField p q = XRec p (HsRecUpdField p q) Source #

Located Haskell Record Update Field

newtype RecFieldsDotDot Source #

Newtype to be able to have a specific XRec instance for the Int in `rec_dotdot`

Constructors

RecFieldsDotDot |
Fields unRecFieldsDotDot :: Int

#### Instances

Instances details

Data RecFieldsDotDot Source # |
Instance details Defined in Language.Haskell.Syntax.Pat Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> RecFieldsDotDot -> c RecFieldsDotDot # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c RecFieldsDotDot # toConstr :: RecFieldsDotDot -> Constr # dataTypeOf :: RecFieldsDotDot -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c RecFieldsDotDot) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RecFieldsDotDot) # gmapT :: (forall b. Data b => b -> b) -> RecFieldsDotDot -> RecFieldsDotDot # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RecFieldsDotDot -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RecFieldsDotDot -> r # gmapQ :: (forall d. Data d => d -> u) -> RecFieldsDotDot -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> RecFieldsDotDot -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> RecFieldsDotDot -> m RecFieldsDotDot # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RecFieldsDotDot -> m RecFieldsDotDot # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RecFieldsDotDot -> m RecFieldsDotDot #
Eq RecFieldsDotDot Source # |
Instance details Defined in Language.Haskell.Syntax.Pat Methods (==) :: RecFieldsDotDot -> RecFieldsDotDot -> Bool # (/=) :: RecFieldsDotDot -> RecFieldsDotDot -> Bool #
Ord RecFieldsDotDot Source # |
Instance details Defined in Language.Haskell.Syntax.Pat Methods compare :: RecFieldsDotDot -> RecFieldsDotDot -> Ordering # (<) :: RecFieldsDotDot -> RecFieldsDotDot -> Bool # (<=) :: RecFieldsDotDot -> RecFieldsDotDot -> Bool # (>) :: RecFieldsDotDot -> RecFieldsDotDot -> Bool # (>=) :: RecFieldsDotDot -> RecFieldsDotDot -> Bool # max :: RecFieldsDotDot -> RecFieldsDotDot -> RecFieldsDotDot # min :: RecFieldsDotDot -> RecFieldsDotDot -> RecFieldsDotDot #
type Anno RecFieldsDotDot Source # |
Instance details Defined in GHC.Hs.Pat type Anno RecFieldsDotDot = SrcSpan

hsRecFields :: UnXRec p => HsRecFields p arg -> [XCFieldOcc p] Source #

hsRecFieldSel :: UnXRec p => HsRecField p arg -> XCFieldOcc p Source #

hsRecFieldId :: HsRecField GhcTc arg -> Id Source #

hsRecFieldsArgs :: UnXRec p => HsRecFields p arg -> [arg] Source #

hsRecUpdFieldId :: HsFieldBind (LAmbiguousFieldOcc GhcTc) arg -> Located Id Source #

hsRecUpdFieldOcc :: HsFieldBind (LAmbiguousFieldOcc GhcTc) arg -> LFieldOcc GhcTc Source #

hsRecUpdFieldRdr :: forall (p :: Pass) q. HsRecUpdField (GhcPass p) q -> Located RdrName Source #

mkPrefixConPat :: DataCon -> [LPat GhcTc] -> [Type] -> LPat GhcTc Source #

mkCharLitPat :: SourceText -> Char -> LPat GhcTc Source #

mkNilPat :: Type -> LPat GhcTc Source #

mkVisPat :: forall (pass :: Pass). XVisPat (GhcPass pass) ~ NoExtField => LPat (GhcPass pass) -> LArgPat (GhcPass pass) Source #

A helper function that constructs an argument pattern (LArgPat) from a pattern (LPat)

mkVisPatX :: forall (pass :: Pass). XVisPat (GhcPass pass) -> LPat (GhcPass pass) -> LArgPat (GhcPass pass) Source #

mkRetainedVisPat :: forall (pass :: Pass). IsPass pass => LPat (GhcPass pass) -> LArgPat (GhcPass pass) Source #

data Erasure Source #

Constructors

Erased |
Retained |

#### Instances

Instances details

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

isSimplePat :: forall (x :: Pass). LPat (GhcPass x) -> Maybe (IdP (GhcPass x)) Source #

Is the pattern any of combination of:

- (pat)
- pat :: Type
- ~pat
- !pat
- x (variable)

isPatSyn :: LPat GhcTc -> Bool Source #

looksLazyPatBind :: HsBind GhcTc -> Bool Source #

isBangedLPat :: forall (p :: Pass). LPat (GhcPass p) -> Bool Source #

gParPat :: forall (p :: Pass). IsPass p => LPat (GhcPass p) -> Pat (GhcPass p) Source #

Parenthesize a pattern without token information

patNeedsParens :: forall (p :: Pass). IsPass p => PprPrec -> Pat (GhcPass p) -> Bool Source #

``patNeedsParens` p pat` returns `True` if the pattern `pat` needs parentheses under precedence `p`.

parenthesizePat :: forall (p :: Pass). IsPass p => PprPrec -> LPat (GhcPass p) -> LPat (GhcPass p) Source #

``parenthesizePat` p pat` checks if ``patNeedsParens` p pat` is true, and if so, surrounds `pat` with a `ParPat`. Otherwise, it simply returns `pat`.

parenthesizeLArgPat :: forall (p :: Pass). IsPass p => PprPrec -> LArgPat (GhcPass p) -> LArgPat (GhcPass p) Source #

isIrrefutableHsPatHelper Source #

Arguments

:: forall (p :: Pass). OutputableBndrId p |
=> Bool | Are we in a `-XStrict` context? See Note [-XStrict and irrefutability]
-> LPat (GhcPass p) |
-> Bool |

(isIrrefutableHsPat p) is true if matching against p cannot fail in the sense of falling through to the next pattern. (NB: this is not quite the same as the (silly) defn in 3.17.2 of the Haskell 98 report.)

WARNING: isIrrefutableHsPat returns False if it's in doubt. Specifically on a ConPatIn, which is what it sees for a (LPat Name) in the renamer, it doesn't know the size of the constructor family, so it returns False. Result: only tuple patterns are considered irrefutable at the renamer stage.

But if it returns True, the pattern is definitely irrefutable Instantiates `isIrrefutableHsPatHelperM` with a trivial identity monad

isIrrefutableHsPatHelperM :: forall m (p :: Pass). (Monad m, OutputableBndrId p) => LPatIrrefutableCheck m (GhcPass p) Source #

isBoringHsPat :: forall (p :: Pass). OutputableBndrId p => LPat (GhcPass p) -> Bool Source #

Is this pattern boring from the perspective of pattern-match checking, i.e. introduces no new pieces of long-distance information which could influence pattern-match checking?

See Note [Boring patterns].

collectEvVarsPat :: Pat GhcTc -> Bag EvVar Source #

collectEvVarsPats :: [Pat GhcTc] -> Bag EvVar Source #

pprParendLArgPat :: forall (p :: Pass). OutputableBndrId p => PprPrec -> LArgPat (GhcPass p) -> SDoc Source #

pprParendLPat :: forall (p :: Pass). OutputableBndrId p => PprPrec -> LPat (GhcPass p) -> SDoc Source #

pprConArgs :: forall (p :: Pass). (OutputableBndrId p, Outputable (Anno (IdGhcP p))) => HsConPatDetails (GhcPass p) -> SDoc Source #

pprLPat :: forall (p :: Pass). OutputableBndrId p => LPat (GhcPass p) -> SDoc Source #

# Orphan instances

OutputableBndrId p => Outputable (ArgPat (GhcPass p)) Source # |
Instance details Methods ppr :: ArgPat (GhcPass p) -> SDoc Source #
Outputable (HsTyPat p) => Outputable (HsConPatTyArg p) Source # |
Instance details Methods ppr :: HsConPatTyArg p -> SDoc Source #
OutputableBndrId p => Outputable (Pat (GhcPass p)) Source # |
Instance details Methods ppr :: Pat (GhcPass p) -> SDoc Source #
(Outputable p, OutputableBndr p, Outputable arg) => Outputable (HsFieldBind p arg) Source # |
Instance details Methods ppr :: HsFieldBind p arg -> SDoc Source #
(Outputable arg, Outputable (XRec p (HsRecField p arg)), XRec p RecFieldsDotDot ~ Located RecFieldsDotDot) => Outputable (HsRecFields p arg) Source # |
Instance details Methods ppr :: HsRecFields p arg -> SDoc Source #