Safe Haskell | None |
---|---|
Language | Haskell2010 |
Generation of pattern-level AST fragments for refactorings.
The bindings defined here create a the annotated version of the AST constructor with the same name.
For example, mkVarPat
creates the annotated version of the VarPat
AST constructor.
- mkVarPat :: Name dom -> Pattern dom
- mkLitPat :: Literal dom -> Pattern dom
- mkInfixAppPat :: Pattern dom -> Operator dom -> Pattern dom -> Pattern dom
- mkAppPat :: Name dom -> [Pattern dom] -> Pattern dom
- mkTuplePat :: [Pattern dom] -> Pattern dom
- mkUnboxTuplePat :: [Pattern dom] -> Pattern dom
- mkListPat :: [Pattern dom] -> Pattern dom
- mkParArrayPat :: [Pattern dom] -> Pattern dom
- mkParenPat :: Pattern dom -> Pattern dom
- mkRecPat :: Name dom -> [PatternField dom] -> Pattern dom
- mkAsPat :: Name dom -> Pattern dom -> Pattern dom
- mkWildPat :: Pattern dom
- mkIrrefutablePat :: Pattern dom -> Pattern dom
- mkBangPat :: Pattern dom -> Pattern dom
- mkTypeSigPat :: Pattern dom -> Type dom -> Pattern dom
- mkViewPat :: Expr dom -> Pattern dom -> Pattern dom
- mkSplicePat :: Splice dom -> Pattern dom
- mkQuasiQuotePat :: QuasiQuote dom -> Pattern dom
- mkPatternField :: Name dom -> Pattern dom -> PatternField dom
- mkFieldPunPattern :: Name dom -> PatternField dom
- mkFieldWildcardPattern :: PatternField dom
Documentation
mkInfixAppPat :: Pattern dom -> Operator dom -> Pattern dom -> Pattern dom Source #
Infix constructor application pattern ( a :+: b
)
mkAppPat :: Name dom -> [Pattern dom] -> Pattern dom Source #
Constructor application pattern ( Point x y
)
mkTuplePat :: [Pattern dom] -> Pattern dom Source #
Tuple pattern ( (x,y)
)
mkUnboxTuplePat :: [Pattern dom] -> Pattern dom Source #
Unboxed tuple pattern ( (# x, y #)
)
mkParArrayPat :: [Pattern dom] -> Pattern dom Source #
Parallel array pattern ( [:1,2,a,x:]
)
mkParenPat :: Pattern dom -> Pattern dom Source #
Parenthesised patterns
mkRecPat :: Name dom -> [PatternField dom] -> Pattern dom Source #
Record pattern ( Point { x = 3, y }
)
mkAsPat :: Name dom -> Pattern dom -> Pattern dom Source #
As-pattern (explicit name binding) ( ls@(hd:_)
)
mkIrrefutablePat :: Pattern dom -> Pattern dom Source #
Irrefutable pattern ( ~(x:_)
)
mkTypeSigPat :: Pattern dom -> Type dom -> Pattern dom Source #
Pattern with explicit type signature ( x :: Int
)
mkSplicePat :: Splice dom -> Pattern dom Source #
Splice patterns: $(generateX inp)
mkQuasiQuotePat :: QuasiQuote dom -> Pattern dom Source #
Quasi-quoted patterns: [| 1 + 2 |]
mkPatternField :: Name dom -> Pattern dom -> PatternField dom Source #
Named field pattern ( p = Point 3 2
)
mkFieldPunPattern :: Name dom -> PatternField dom Source #
Named field pun ( p
)
mkFieldWildcardPattern :: PatternField dom Source #
Wildcard field pattern ( ..
)