| Copyright | (c) 2020 Kowainik |
|---|---|
| License | MPL-2.0 |
| Maintainer | Kowainik <xrom.xkov@gmail.com> |
| Safe Haskell | None |
| Language | Haskell2010 |
Stan.Pattern.Type
Description
Patterns for types and type search.
Synopsis
- data PatternType
- (|->) :: PatternType -> PatternType -> PatternType
- (|::) :: NameMeta -> [PatternType] -> PatternType
- listPattern :: PatternType
- nonEmptyPattern :: PatternType
- listFunPattern :: PatternType
- integerPattern :: PatternType
- naturalPattern :: PatternType
- rationalPattern :: PatternType
- scientificPattern :: PatternType
- charPattern :: PatternType
- stringPattern :: PatternType
- textPattern :: PatternType
- foldableTypesPatterns :: NonEmpty PatternType
- foldableMethodsPatterns :: NonEmpty (NameMeta, PatternType -> PatternType)
Type
data PatternType #
Query pattern used to search types in HIE AST.
Constructors
| PatternTypeName !NameMeta ![PatternType] | Argument, type or constructor:
| ||||||
| PatternTypeFun !PatternType !PatternType | Function pattern. | ||||||
| PatternTypeAnything | Type wildcard, matches anything. | ||||||
| PatternTypeOr !PatternType !PatternType | Choice between patterns. Should match either of them. | ||||||
| PatternTypeAnd !PatternType !PatternType | Union of patterns. Should match both of them. | ||||||
| PatternTypeNeg !PatternType | Negation of pattern. Should match everything except this pattern. |
Instances
| Show PatternType # | |
Defined in Stan.Pattern.Type Methods showsPrec :: Int -> PatternType -> ShowS # show :: PatternType -> String # showList :: [PatternType] -> ShowS # | |
| Eq PatternType # | |
Defined in Stan.Pattern.Type | |
| PatternBool PatternType # | |
Defined in Stan.Pattern.Type Methods (?) :: PatternType # neg :: PatternType -> PatternType # (|||) :: PatternType -> PatternType -> PatternType # (&&&) :: PatternType -> PatternType -> PatternType # | |
eDSL
(|->) :: PatternType -> PatternType -> PatternType infixr 4 #
Short operator alias for PatternFun.
(|::) :: NameMeta -> [PatternType] -> PatternType infix 5 #
Short operator alias for PatternTypeName.
Common PatternTypes
PatternType for list [a] or .String
listFunPattern :: PatternType #
PatternType for [a] -> _ or String -> _.
integerPattern :: PatternType #
PatternType for Integer.
naturalPattern :: PatternType #
PatternType for Natural.
Textual types
stringPattern :: PatternType #
PatternType for String.
PatternType for Text.
Foldable patterns
foldableTypesPatterns :: NonEmpty PatternType #
List of types for STAN-0207.