Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data PatSyn
- type PatSynMatcher = (Name, Type, Bool)
- type PatSynBuilder = Maybe (Name, Type, Bool)
- mkPatSyn :: Name -> Bool -> ([InvisTVBinder], ThetaType) -> ([InvisTVBinder], ThetaType) -> [Type] -> Type -> PatSynMatcher -> PatSynBuilder -> [FieldLabel] -> PatSyn
- patSynName :: PatSyn -> Name
- patSynArity :: PatSyn -> Arity
- patSynIsInfix :: PatSyn -> Bool
- patSynResultType :: PatSyn -> Type
- patSynArgs :: PatSyn -> [Type]
- patSynMatcher :: PatSyn -> PatSynMatcher
- patSynBuilder :: PatSyn -> PatSynBuilder
- patSynUnivTyVarBinders :: PatSyn -> [InvisTVBinder]
- patSynExTyVars :: PatSyn -> [TyVar]
- patSynExTyVarBinders :: PatSyn -> [InvisTVBinder]
- patSynSig :: PatSyn -> ([TyVar], ThetaType, [TyVar], ThetaType, [Scaled Type], Type)
- patSynSigBndr :: PatSyn -> ([InvisTVBinder], ThetaType, [InvisTVBinder], ThetaType, [Scaled Type], Type)
- patSynInstArgTys :: PatSyn -> [Type] -> [Type]
- patSynInstResTy :: PatSyn -> [Type] -> Type
- patSynFieldLabels :: PatSyn -> [FieldLabel]
- patSynFieldType :: PatSyn -> FieldLabelString -> Type
- pprPatSynType :: PatSyn -> SDoc
Main data types
Pattern Synonym
See Note [Pattern synonym representation] See Note [Pattern synonym signature contexts]
Instances
Data PatSyn Source # | |
Defined in GHC.Core.PatSyn gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PatSyn -> c PatSyn Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PatSyn Source # toConstr :: PatSyn -> Constr Source # dataTypeOf :: PatSyn -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c PatSyn) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PatSyn) Source # gmapT :: (forall b. Data b => b -> b) -> PatSyn -> PatSyn Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PatSyn -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PatSyn -> r Source # gmapQ :: (forall d. Data d => d -> u) -> PatSyn -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> PatSyn -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> PatSyn -> m PatSyn Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PatSyn -> m PatSyn Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PatSyn -> m PatSyn Source # | |
NamedThing PatSyn Source # | |
Uniquable PatSyn Source # | |
Outputable PatSyn Source # | |
OutputableBndr PatSyn Source # | |
Defined in GHC.Core.PatSyn | |
Eq PatSyn Source # | |
:: Name | |
-> Bool | Is the pattern synonym declared infix? |
-> ([InvisTVBinder], ThetaType) | Universially-quantified type variables and required dicts |
-> ([InvisTVBinder], ThetaType) | Existentially-quantified type variables and provided dicts |
-> [Type] | Original arguments |
-> Type | Original result type |
-> PatSynMatcher | Matcher |
-> PatSynBuilder | 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
patSynResultType :: PatSyn -> Type Source #
patSynArgs :: PatSyn -> [Type] Source #
patSynMatcher :: PatSyn -> PatSynMatcher Source #
patSynBuilder :: PatSyn -> PatSynBuilder Source #
patSynUnivTyVarBinders :: PatSyn -> [InvisTVBinder] Source #
patSynExTyVars :: PatSyn -> [TyVar] Source #
patSynExTyVarBinders :: PatSyn -> [InvisTVBinder] Source #
patSynSigBndr :: PatSyn -> ([InvisTVBinder], ThetaType, [InvisTVBinder], ThetaType, [Scaled Type], Type) 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