| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Elara.AST.Traversal
Synopsis
- class TraverseExtensions (p :: k) where
- traverseExpressionExtensionExprs :: forall loc f. Applicative f => (Expr loc p -> f (Expr loc p)) -> ExpressionExtension p loc -> f (ExpressionExtension p loc)
- traversePatternExtensionPats :: forall loc f. Applicative f => (Pattern loc p -> f (Pattern loc p)) -> PatternExtension p loc -> f (PatternExtension p loc)
- traverseTypeExtensionTypes :: forall loc f. Applicative f => (Type loc p -> f (Type loc p)) -> TypeSyntaxExtension p loc -> f (TypeSyntaxExtension p loc)
- traverseExprExprs :: forall {k} loc (p :: k) f. (Applicative f, Plated (Expr loc p) (Expr loc p)) => (Expr loc p -> f (Expr loc p)) -> Expr loc p -> f (Expr loc p)
- traversePatternPats :: forall {k} loc (p :: k) f. (Applicative f, Plated (Pattern loc p) (Pattern loc p)) => (Pattern loc p -> f (Pattern loc p)) -> Pattern loc p -> f (Pattern loc p)
- traverseTypeTypes :: forall {k} loc (p :: k) f. (Applicative f, Plated (Type loc p) (Type loc p)) => (Type loc p -> f (Type loc p)) -> Type loc p -> f (Type loc p)
Documentation
class TraverseExtensions (p :: k) where Source #
Traversal class for phase-specific extension constructors. Each phase that has non-Void extensions must provide an instance. Phases with Void extensions get trivial instances (just use absurd).
Methods
traverseExpressionExtensionExprs :: forall loc f. Applicative f => (Expr loc p -> f (Expr loc p)) -> ExpressionExtension p loc -> f (ExpressionExtension p loc) Source #
Traverse all sub-expressions within an expression extension
traversePatternExtensionPats :: forall loc f. Applicative f => (Pattern loc p -> f (Pattern loc p)) -> PatternExtension p loc -> f (PatternExtension p loc) Source #
Traverse all sub-patterns within a pattern extension
traverseTypeExtensionTypes :: forall loc f. Applicative f => (Type loc p -> f (Type loc p)) -> TypeSyntaxExtension p loc -> f (TypeSyntaxExtension p loc) Source #
Traverse all sub-types within a type extension
traverseExprExprs :: forall {k} loc (p :: k) f. (Applicative f, Plated (Expr loc p) (Expr loc p)) => (Expr loc p -> f (Expr loc p)) -> Expr loc p -> f (Expr loc p) Source #
Traverse all immediate sub-expressions of an expression node