ghc-lib-parser-9.0.1.20210324: The GHC API, decoupled from GHC versions
Safe HaskellNone
LanguageHaskell2010

GHC.Hs.Pat

Synopsis

Documentation

data Pat p Source #

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) (Located (IdP p))

Variable Pattern

LazyPat (XLazyPat p) (LPat p)

Lazy Pattern ^ - AnnKeywordId : AnnTilde

AsPat (XAsPat p) (Located (IdP 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

TuplePat (XTuplePat p) [LPat p] Boxity

Tuple sub-patterns

SumPat (XSumPat p) (LPat p) ConTag Arity

Anonymous sum pattern

ConPat

Constructor Pattern

ViewPat (XViewPat p) (LHsExpr p) (LPat p)

View Pattern

SplicePat (XSplicePat p) (HsSplice p)

Splice Pattern (Includes quasi-quotes)

LitPat (XLitPat p) (HsLit p)

Literal Pattern Used for *non-overloaded* literal patterns: Int, Int, Char, String, etc.

NPat (XNPat p) (Located (HsOverLit p)) (Maybe (SyntaxExpr p)) (SyntaxExpr p)

Natural Pattern

NPlusKPat (XNPlusKPat p) (Located (IdP p)) (Located (HsOverLit p)) (HsOverLit p) (SyntaxExpr p) (SyntaxExpr p)

n+k pattern

SigPat (XSigPat p) (LPat p) (HsPatSigType (NoGhcTc p))

Pattern with a type signature

XPat !(XXPat p)

Trees that Grow extension point for new constructors

Instances

Instances details
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) #

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 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) #

OutputableBndrId p => Outputable (Pat (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Pat

Methods

ppr :: Pat (GhcPass p) -> SDoc Source #

pprPrec :: Rational -> Pat (GhcPass p) -> SDoc Source #

type LPat p = XRec p Pat Source #

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
     

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 #

data CoPat Source #

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.

Constructors

CoPat 

Fields

Instances

Instances details
Data CoPat 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) -> CoPat -> c CoPat #

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

toConstr :: CoPat -> Constr #

dataTypeOf :: CoPat -> DataType #

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

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

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

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

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

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

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

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

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

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

data ListPatTc Source #

Instances

Instances details
Data ListPatTc 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) -> ListPatTc -> c ListPatTc #

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

toConstr :: ListPatTc -> Constr #

dataTypeOf :: ListPatTc -> DataType #

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

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

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

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

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

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

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

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

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

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

type family ConLikeP x Source #

Instances

Instances details
type ConLikeP GhcTc Source # 
Instance details

Defined in GHC.Hs.Pat

type ConLikeP GhcRn Source # 
Instance details

Defined in GHC.Hs.Pat

type ConLikeP GhcPs Source # 
Instance details

Defined in GHC.Hs.Pat

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

Haskell Constructor Pattern Details

data HsRecFields p arg Source #

Haskell Record Fields

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

Constructors

HsRecFields 

Fields

Instances

Instances details
Functor (HsRecFields p) Source # 
Instance details

Defined in GHC.Hs.Pat

Methods

fmap :: (a -> b) -> HsRecFields p a -> HsRecFields p b #

(<$) :: a -> HsRecFields p b -> HsRecFields p a #

Foldable (HsRecFields p) Source # 
Instance details

Defined in GHC.Hs.Pat

Methods

fold :: Monoid m => HsRecFields p m -> m #

foldMap :: Monoid m => (a -> m) -> HsRecFields p a -> m #

foldMap' :: Monoid m => (a -> m) -> HsRecFields p a -> m #

foldr :: (a -> b -> b) -> b -> HsRecFields p a -> b #

foldr' :: (a -> b -> b) -> b -> HsRecFields p a -> b #

foldl :: (b -> a -> b) -> b -> HsRecFields p a -> b #

foldl' :: (b -> a -> b) -> b -> HsRecFields p a -> b #

foldr1 :: (a -> a -> a) -> HsRecFields p a -> a #

foldl1 :: (a -> a -> a) -> HsRecFields p a -> a #

toList :: HsRecFields p a -> [a] #

null :: HsRecFields p a -> Bool #

length :: HsRecFields p a -> Int #

elem :: Eq a => a -> HsRecFields p a -> Bool #

maximum :: Ord a => HsRecFields p a -> a #

minimum :: Ord a => HsRecFields p a -> a #

sum :: Num a => HsRecFields p a -> a #

product :: Num a => HsRecFields p a -> a #

Traversable (HsRecFields p) Source # 
Instance details

Defined in GHC.Hs.Pat

Methods

traverse :: Applicative f => (a -> f b) -> HsRecFields p a -> f (HsRecFields p b) #

sequenceA :: Applicative f => HsRecFields p (f a) -> f (HsRecFields p a) #

mapM :: Monad m => (a -> m b) -> HsRecFields p a -> m (HsRecFields p b) #

sequence :: Monad m => HsRecFields p (m a) -> m (HsRecFields p a) #

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 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 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) #

Outputable arg => Outputable (HsRecFields p arg) Source # 
Instance details

Defined in GHC.Hs.Pat

Methods

ppr :: HsRecFields p arg -> SDoc Source #

pprPrec :: Rational -> HsRecFields p arg -> SDoc Source #

data HsRecField' id arg Source #

Haskell Record Field

For details on above see note [Api annotations] in GHC.Parser.Annotation

Constructors

HsRecField 

Fields

Instances

Instances details
Functor (HsRecField' id) Source # 
Instance details

Defined in GHC.Hs.Pat

Methods

fmap :: (a -> b) -> HsRecField' id a -> HsRecField' id b #

(<$) :: a -> HsRecField' id b -> HsRecField' id a #

Foldable (HsRecField' id) Source # 
Instance details

Defined in GHC.Hs.Pat

Methods

fold :: Monoid m => HsRecField' id m -> m #

foldMap :: Monoid m => (a -> m) -> HsRecField' id a -> m #

foldMap' :: Monoid m => (a -> m) -> HsRecField' id a -> m #

foldr :: (a -> b -> b) -> b -> HsRecField' id a -> b #

foldr' :: (a -> b -> b) -> b -> HsRecField' id a -> b #

foldl :: (b -> a -> b) -> b -> HsRecField' id a -> b #

foldl' :: (b -> a -> b) -> b -> HsRecField' id a -> b #

foldr1 :: (a -> a -> a) -> HsRecField' id a -> a #

foldl1 :: (a -> a -> a) -> HsRecField' id a -> a #

toList :: HsRecField' id a -> [a] #

null :: HsRecField' id a -> Bool #

length :: HsRecField' id a -> Int #

elem :: Eq a => a -> HsRecField' id a -> Bool #

maximum :: Ord a => HsRecField' id a -> a #

minimum :: Ord a => HsRecField' id a -> a #

sum :: Num a => HsRecField' id a -> a #

product :: Num a => HsRecField' id a -> a #

Traversable (HsRecField' id) Source # 
Instance details

Defined in GHC.Hs.Pat

Methods

traverse :: Applicative f => (a -> f b) -> HsRecField' id a -> f (HsRecField' id b) #

sequenceA :: Applicative f => HsRecField' id (f a) -> f (HsRecField' id a) #

mapM :: Monad m => (a -> m b) -> HsRecField' id a -> m (HsRecField' id b) #

sequence :: Monad m => HsRecField' id (m a) -> m (HsRecField' id a) #

(Data id, Data arg) => Data (HsRecField' id arg) 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) -> HsRecField' id arg -> c (HsRecField' id arg) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (HsRecField' id arg) #

toConstr :: HsRecField' id arg -> Constr #

dataTypeOf :: HsRecField' id arg -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (HsRecField' id arg)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (HsRecField' id arg)) #

gmapT :: (forall b. Data b => b -> b) -> HsRecField' id arg -> HsRecField' id arg #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HsRecField' id arg -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HsRecField' id arg -> r #

gmapQ :: (forall d. Data d => d -> u) -> HsRecField' id arg -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> HsRecField' id arg -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> HsRecField' id arg -> m (HsRecField' id arg) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HsRecField' id arg -> m (HsRecField' id arg) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HsRecField' id arg -> m (HsRecField' id arg) #

(Outputable p, Outputable arg) => Outputable (HsRecField' p arg) Source # 
Instance details

Defined in GHC.Hs.Pat

Methods

ppr :: HsRecField' p arg -> SDoc Source #

pprPrec :: Rational -> HsRecField' p arg -> SDoc Source #

type LHsRecField' p arg = Located (HsRecField' p arg) Source #

Located Haskell Record Field

type HsRecField p arg = HsRecField' (FieldOcc p) arg Source #

Haskell Record Field

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

Located Haskell Record Field

type HsRecUpdField p = HsRecField' (AmbiguousFieldOcc p) (LHsExpr p) Source #

Haskell Record Update Field

type LHsRecUpdField p = Located (HsRecUpdField p) Source #

Located Haskell Record Update Field

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

Is the pattern any of combination of:

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

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

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

parenthesizePat :: 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.