ghc-7.8.4: The GHC API

Safe Haskell | None
Language | Haskell98

PatSyn

Contents

- Main data types
  - Type deconstruction

Synopsis

- data PatSyn
- mkPatSyn :: Name -> Bool -> [Type] -> [TyVar] -> [TyVar] -> ThetaType -> ThetaType -> Type -> Id -> Maybe Id -> PatSyn
- patSynName :: PatSyn -> Name
- patSynArity :: PatSyn -> Arity
- patSynIsInfix :: PatSyn -> Bool
- patSynArgs :: PatSyn -> [Type]
- patSynTyDetails :: PatSyn -> HsPatSynDetails Type
- patSynType :: PatSyn -> Type
- patSynWrapper :: PatSyn -> Maybe Id
- patSynMatcher :: PatSyn -> Id
- 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

A pattern synonym See Note [Pattern synonym representation]

Instances

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

mkPatSyn

Arguments

:: Name |
-> Bool | Is the pattern synonym declared infix?
-> [Type] | Original arguments
-> [TyVar] | Universially-quantified type variables
-> [TyVar] | Existentially-quantified type variables
-> ThetaType | Wanted dicts
-> ThetaType | Given dicts
-> Type | Original result type
-> Id | Name of matcher
-> Maybe Id | Name of wrapper
-> PatSyn |

Build a new pattern synonym

## Type deconstruction

patSynName :: PatSyn -> Name

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

patSynArity :: PatSyn -> Arity

Arity of the pattern synonym

patSynIsInfix :: PatSyn -> Bool

Should the `PatSyn` be presented infix?

patSynArgs :: PatSyn -> [Type]

patSynTyDetails :: PatSyn -> HsPatSynDetails Type

patSynType :: PatSyn -> Type

patSynWrapper :: PatSyn -> Maybe Id

patSynMatcher :: PatSyn -> Id

patSynExTyVars :: PatSyn -> [TyVar]

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

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

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

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