Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data PatSyn
- mkPatSyn :: Name -> Bool -> ([TyVarBinder], ThetaType) -> ([TyVarBinder], ThetaType) -> [Type] -> Type -> (Id, Bool) -> Maybe (Id, Bool) -> [FieldLabel] -> PatSyn
- patSynName :: PatSyn -> Name
- patSynArity :: PatSyn -> Arity
- patSynIsInfix :: PatSyn -> Bool
- patSynArgs :: PatSyn -> [Type]
- patSynMatcher :: PatSyn -> (Id, Bool)
- patSynBuilder :: PatSyn -> Maybe (Id, Bool)
- patSynUnivTyVarBinders :: PatSyn -> [TyVarBinder]
- patSynExTyVars :: PatSyn -> [TyVar]
- patSynExTyVarBinders :: PatSyn -> [TyVarBinder]
- patSynSig :: PatSyn -> ([TyVar], ThetaType, [TyVar], ThetaType, [Type], Type)
- patSynInstArgTys :: PatSyn -> [Type] -> [Type]
- patSynInstResTy :: PatSyn -> [Type] -> Type
- patSynFieldLabels :: PatSyn -> [FieldLabel]
- patSynFieldType :: PatSyn -> FieldLabelString -> Type
- tidyPatSynIds :: (Id -> Id) -> PatSyn -> PatSyn
- pprPatSynType :: PatSyn -> SDoc
Main data types
Pattern Synonym
See Note [Pattern synonym representation] See Note [Pattern synonym signature contexts]
:: Name | |
-> Bool | Is the pattern synonym declared infix? |
-> ([TyVarBinder], ThetaType) | Universially-quantified type variables and required dicts |
-> ([TyVarBinder], 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 |
-> [FieldLabel] | Names of fields for a record pattern synonym |
-> PatSyn |
Build a new pattern synonym
Type deconstruction
patSynName :: PatSyn -> Name Source #
patSynArity :: PatSyn -> Arity Source #
Arity of the pattern synonym
patSynArgs :: PatSyn -> [Type] Source #
patSynUnivTyVarBinders :: PatSyn -> [TyVarBinder] Source #
patSynExTyVars :: PatSyn -> [TyVar] Source #
patSynExTyVarBinders :: PatSyn -> [TyVarBinder] Source #
patSynFieldLabels :: PatSyn -> [FieldLabel] Source #
patSynFieldType :: PatSyn -> FieldLabelString -> Type Source #
Extract the type for any given labelled field of the DataCon
pprPatSynType :: PatSyn -> SDoc Source #
Print the type of a pattern synonym. The foralls are printed explicitly