ghc-7.10.2: The GHC API

Safe Haskell | None
Language | Haskell2010

PatSyn

Contents

- Main data types
  - Type deconstruction

Synopsis

- data PatSyn
- mkPatSyn :: Name -> Bool -> ([TyVar], ThetaType) -> ([TyVar], ThetaType) -> [Type] -> Type -> (Id, Bool) -> Maybe (Id, Bool) -> PatSyn
- patSynName :: PatSyn -> Name
- patSynArity :: PatSyn -> Arity
- patSynIsInfix :: PatSyn -> Bool
- patSynArgs :: PatSyn -> [Type]
- patSynTyDetails :: PatSyn -> HsPatSynDetails Type
- patSynType :: PatSyn -> Type
- patSynMatcher :: PatSyn -> (Id, Bool)
- patSynBuilder :: PatSyn -> Maybe (Id, Bool)
- patSynExTyVars :: PatSyn -> [TyVar]
- patSynSig :: PatSyn -> ([TyVar], [TyVar], ThetaType, ThetaType, [Type], Type)
- patSynInstArgTys :: PatSyn -> [Type] -> [Type]
- patSynInstResTy :: PatSyn -> [Type] -> Type
- tidyPatSynIds :: (Id -> Id) -> PatSyn -> PatSyn

# Main data types

data PatSyn Source

A pattern synonym See Note [Pattern synonym representation]

Instances

Eq PatSyn |
Data PatSyn |
Ord PatSyn |
OutputableBndr PatSyn |
Outputable PatSyn |
Uniquable PatSyn |
NamedThing PatSyn |

mkPatSyn Source

Arguments

:: Name |
-> Bool | Is the pattern synonym declared infix?
-> ([TyVar], ThetaType) | Universially-quantified type variables and required dicts
-> ([TyVar], ThetaType) | Existentially-quantified type variables and provided dicts
-> [Type] | Original arguments
-> Type | Original result type
-> (Id, Bool) | Name of matcher
-> Maybe (Id, Bool) | Name of builder
-> PatSyn |

Build a new pattern synonym

## Type deconstruction

patSynName :: PatSyn -> Name Source

The `Name` of the `PatSyn`, giving it a unique, rooted identification

patSynArity :: PatSyn -> Arity Source

Arity of the pattern synonym

patSynIsInfix :: PatSyn -> Bool Source

Should the `PatSyn` be presented infix?

patSynArgs :: PatSyn -> [Type] Source

patSynTyDetails :: PatSyn -> HsPatSynDetails Type Source

patSynType :: PatSyn -> Type Source

patSynMatcher :: PatSyn -> (Id, Bool) Source

patSynBuilder :: PatSyn -> Maybe (Id, Bool) Source

patSynExTyVars :: PatSyn -> [TyVar] Source

patSynSig :: PatSyn -> ([TyVar], [TyVar], ThetaType, ThetaType, [Type], Type) Source

patSynInstArgTys :: PatSyn -> [Type] -> [Type] Source

patSynInstResTy :: PatSyn -> [Type] -> Type Source

tidyPatSynIds :: (Id -> Id) -> PatSyn -> PatSyn Source