Copyright | (c) 2020 Kowainik |
---|---|
License | MPL-2.0 |
Maintainer | Kowainik <xrom.xkov@gmail.com> |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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
- charPattern :: PatternType
- stringPattern :: PatternType
- textPattern :: PatternType
- foldableTypesPatterns :: NonEmpty PatternType
- foldableMethodsPatterns :: NonEmpty (NameMeta, PatternType -> PatternType)
Type
data PatternType Source #
Query pattern used to search types in HIE AST.
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 Source # | |
Defined in Stan.Pattern.Type showsPrec :: Int -> PatternType -> ShowS # show :: PatternType -> String # showList :: [PatternType] -> ShowS # | |
Eq PatternType Source # | |
Defined in Stan.Pattern.Type (==) :: PatternType -> PatternType -> Bool # (/=) :: PatternType -> PatternType -> Bool # | |
PatternBool PatternType Source # | |
Defined in Stan.Pattern.Type (?) :: PatternType Source # neg :: PatternType -> PatternType Source # (|||) :: PatternType -> PatternType -> PatternType Source # (&&&) :: PatternType -> PatternType -> PatternType Source # |
eDSL
(|->) :: PatternType -> PatternType -> PatternType infixr 4 Source #
Short operator alias for PatternFun
.
(|::) :: NameMeta -> [PatternType] -> PatternType infix 5 Source #
Short operator alias for PatternTypeName
.
Common PatternType
s
listPattern :: PatternType Source #
PatternType
for list [a]
or
.String
listFunPattern :: PatternType Source #
PatternType
for [a] -> _
or String -> _
.
Textual types
stringPattern :: PatternType Source #
PatternType
for String
.
textPattern :: PatternType Source #
PatternType
for Text
.
Foldable patterns
foldableTypesPatterns :: NonEmpty PatternType Source #
List of types for STAN-0207
.