Copyright | (c) 2020 Kowainik |
---|---|
License | MPL-2.0 |
Maintainer | Kowainik <xrom.xkov@gmail.com> |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Embedded DSL for patterns (AST and Type). Implemented using the Final Taggless approach.
Synopsis
- class PatternBool a where
Documentation
class PatternBool a where Source #
Common interface for Bool
-like parts of patterns. Allows to
write composable and reusable complex pattern definitions from smaller
pieces.
Laws (in terms of matching functions that return Bool
):
Anything. Matching should always return True
.
Negation. Inverses the argument.
(|||) :: a -> a -> a infixr 2 Source #
Or-pattern. Choice.
(&&&) :: a -> a -> a infixr 3 Source #
And-pattern. Both.
Instances
PatternBool PatternAst Source # | |
Defined in Stan.Pattern.Ast (?) :: PatternAst Source # neg :: PatternAst -> PatternAst Source # (|||) :: PatternAst -> PatternAst -> PatternAst Source # (&&&) :: PatternAst -> PatternAst -> PatternAst Source # | |
PatternBool PatternType Source # | |
Defined in Stan.Pattern.Type (?) :: PatternType Source # neg :: PatternType -> PatternType Source # (|||) :: PatternType -> PatternType -> PatternType Source # (&&&) :: PatternType -> PatternType -> PatternType Source # |