ghc-8.2.2: The GHC API

Safe HaskellNone
LanguageHaskell2010

HsPat

Synopsis

Documentation

data Pat id Source #

Constructors

WildPat (PostTc id Type)

Wildcard Pattern The sole reason for a type on a WildPat is to support hsPatType :: Pat Id -> Type

VarPat (Located id)

Variable Pattern

LazyPat (LPat id)

Lazy Pattern ^ - AnnKeywordId : AnnTilde

AsPat (Located id) (LPat id)

As pattern ^ - AnnKeywordId : AnnAt

ParPat (LPat id)

Parenthesised pattern See Note [Parens in HsSyn] in HsExpr ^ - AnnKeywordId : AnnOpen '(', AnnClose ')'

BangPat (LPat id)

Bang pattern ^ - AnnKeywordId : AnnBang

ListPat [LPat id] (PostTc id Type) (Maybe (PostTc id Type, SyntaxExpr id))

Syntactic List

TuplePat [LPat id] Boxity [PostTc id Type]

Tuple sub-patterns

SumPat (LPat id) ConTag Arity (PostTc id [Type])

Anonymous sum pattern

PArrPat [LPat id] (PostTc id Type)
ConPatIn (Located id) (HsConPatDetails id)

Constructor Pattern In

ConPatOut

Constructor Pattern Out

ViewPat (LHsExpr id) (LPat id) (PostTc id Type)

View Pattern

SplicePat (HsSplice id)

Splice Pattern (Includes quasi-quotes)

LitPat HsLit

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

NPat (Located (HsOverLit id)) (Maybe (SyntaxExpr id)) (SyntaxExpr id) (PostTc id Type)

Natural Pattern

NPlusKPat (Located id) (Located (HsOverLit id)) (HsOverLit id) (SyntaxExpr id) (SyntaxExpr id) (PostTc id Type)

n+k pattern

SigPatIn (LPat id) (LHsSigWcType id)

Pattern with a type signature

SigPatOut (LPat id) Type

Pattern with a type signature

CoPat HsWrapper (Pat id) Type

Coercion Pattern

Instances

DataId id => Data (Pat id) Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Pat id -> c (Pat id) #

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

toConstr :: Pat id -> Constr #

dataTypeOf :: Pat id -> DataType #

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

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

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

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

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

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

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

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

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

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

OutputableBndrId name => Outputable (Pat name) Source # 

Methods

ppr :: Pat name -> SDoc Source #

pprPrec :: Rational -> Pat name -> SDoc Source #

type InPat id = LPat id Source #

type OutPat id = LPat id Source #

type LPat id = Located (Pat id) Source #

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

Haskell Constructor Pattern Details

data HsRecFields id arg Source #

Haskell Record Fields

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

Constructors

HsRecFields 

Fields

Instances

Functor (HsRecFields id) Source # 

Methods

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

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

Foldable (HsRecFields id) Source # 

Methods

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

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

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

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

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

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

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

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

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

null :: HsRecFields id a -> Bool #

length :: HsRecFields id a -> Int #

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

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

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

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

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

Traversable (HsRecFields id) Source # 

Methods

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

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

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

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

(DataId id, Data arg) => Data (HsRecFields id arg) Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> HsRecFields id arg -> c (HsRecFields id arg) #

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

toConstr :: HsRecFields id arg -> Constr #

dataTypeOf :: HsRecFields id arg -> DataType #

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

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

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

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

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

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

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

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

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

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

Outputable arg => Outputable (HsRecFields id arg) Source # 

Methods

ppr :: HsRecFields id arg -> SDoc Source #

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

data HsRecField' id arg Source #

Haskell Record Field

For details on above see note [Api annotations] in ApiAnnotation

Constructors

HsRecField 

Fields

Instances

Functor (HsRecField' id) Source # 

Methods

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

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

Foldable (HsRecField' id) Source # 

Methods

fold :: Monoid m => HsRecField' id m -> 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 # 

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

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 :: (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 id, Outputable arg) => Outputable (HsRecField' id arg) Source # 

Methods

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

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

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

Located Haskell Record Field

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

Haskell Record Field

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

Located Haskell Record Field

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

Haskell Record Update Field

type LHsRecUpdField id = Located (HsRecUpdField id) Source #

Located Haskell Record Update Field

hsRecFields :: HsRecFields id arg -> [PostRn id id] Source #

hsRecFieldSel :: HsRecField name arg -> Located (PostRn name name) Source #

hsRecFieldsArgs :: HsRecFields id arg -> [arg] Source #