ghc-8.2.1: 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) # 

Methods

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

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

toConstr :: Pat id -> Constr Source #

dataTypeOf :: Pat id -> DataType Source #

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

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

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

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

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

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

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

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

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

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

OutputableBndrId name => Outputable (Pat name) # 

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

Methods

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

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

Foldable (HsRecFields id) # 

Methods

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

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

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

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

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

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

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

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

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

null :: HsRecFields id a -> Bool Source #

length :: HsRecFields id a -> Int Source #

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

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

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

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

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

Traversable (HsRecFields id) # 

Methods

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

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

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

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

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

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

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

toConstr :: HsRecFields id arg -> Constr Source #

dataTypeOf :: HsRecFields id arg -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Outputable arg => Outputable (HsRecFields id arg) # 

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

Methods

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

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

Foldable (HsRecField' id) # 

Methods

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

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

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

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

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

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

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

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

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

null :: HsRecField' id a -> Bool Source #

length :: HsRecField' id a -> Int Source #

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

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

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

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

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

Traversable (HsRecField' id) # 

Methods

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

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

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

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

(Data arg, Data id) => Data (HsRecField' id arg) # 

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

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

toConstr :: HsRecField' id arg -> Constr Source #

dataTypeOf :: HsRecField' id arg -> DataType Source #

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

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

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

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

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

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

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

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

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

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

(Outputable id, Outputable arg) => Outputable (HsRecField' id arg) # 

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 #