Safe Haskell | None |
---|---|
Language | Haskell2010 |
Generic traversal and reduce for concrete syntax, in the style of Agda.Syntax.Internal.Generic.
However, here we use the terminology of Traversable
.
Synopsis
- class ExprLike a where
- class FoldDecl a where
- foldDecl :: Monoid m => (Declaration -> m) -> a -> m
- class TraverseDecl a where
- preTraverseDecl :: Monad m => (Declaration -> m Declaration) -> a -> m a
Documentation
class ExprLike a where Source #
Generic traversals for concrete expressions.
Note: does not go into patterns!
Nothing
mapExpr :: (Expr -> Expr) -> a -> a Source #
This corresponds to map
.
default mapExpr :: forall (t :: Type -> Type) b. (Functor t, ExprLike b, t b ~ a) => (Expr -> Expr) -> a -> a Source #
foldExpr :: Monoid m => (Expr -> m) -> a -> m Source #
This corresponds to foldMap
.
default foldExpr :: forall m (t :: Type -> Type) b. (Monoid m, Foldable t, ExprLike b, t b ~ a) => (Expr -> m) -> a -> m Source #
traverseExpr :: Monad m => (Expr -> m Expr) -> a -> m a Source #
This corresponds to mapM
.
Instances
class FoldDecl a where Source #
Nothing
foldDecl :: Monoid m => (Declaration -> m) -> a -> m Source #
Collect declarations and subdeclarations, transitively. Prefix-order tree traversal.
default foldDecl :: forall m (t :: Type -> Type) b. (Monoid m, Foldable t, FoldDecl b, t b ~ a) => (Declaration -> m) -> a -> m Source #
Instances
FoldDecl Declaration Source # | |
Defined in Agda.Syntax.Concrete.Generic foldDecl :: Monoid m => (Declaration -> m) -> Declaration -> m Source # | |
FoldDecl a => FoldDecl (WhereClause' a) Source # | |
Defined in Agda.Syntax.Concrete.Generic foldDecl :: Monoid m => (Declaration -> m) -> WhereClause' a -> m Source # | |
FoldDecl a => FoldDecl (List1 a) Source # | |
Defined in Agda.Syntax.Concrete.Generic foldDecl :: Monoid m => (Declaration -> m) -> List1 a -> m Source # | |
FoldDecl a => FoldDecl (List2 a) Source # | |
Defined in Agda.Syntax.Concrete.Generic foldDecl :: Monoid m => (Declaration -> m) -> List2 a -> m Source # | |
FoldDecl a => FoldDecl [a] Source # | |
Defined in Agda.Syntax.Concrete.Generic foldDecl :: Monoid m => (Declaration -> m) -> [a] -> m Source # |
class TraverseDecl a where Source #
Nothing
preTraverseDecl :: Monad m => (Declaration -> m Declaration) -> a -> m a Source #
Update declarations and their subdeclarations. Prefix-order traversal: traverses subdeclarations of updated declaration.
default preTraverseDecl :: forall m (t :: Type -> Type) b. (Monad m, Traversable t, TraverseDecl b, t b ~ a) => (Declaration -> m Declaration) -> a -> m a Source #
Instances
TraverseDecl Declaration Source # | |
Defined in Agda.Syntax.Concrete.Generic preTraverseDecl :: Monad m => (Declaration -> m Declaration) -> Declaration -> m Declaration Source # | |
TraverseDecl a => TraverseDecl (WhereClause' a) Source # | |
Defined in Agda.Syntax.Concrete.Generic preTraverseDecl :: Monad m => (Declaration -> m Declaration) -> WhereClause' a -> m (WhereClause' a) Source # | |
TraverseDecl a => TraverseDecl (List1 a) Source # | |
Defined in Agda.Syntax.Concrete.Generic preTraverseDecl :: Monad m => (Declaration -> m Declaration) -> List1 a -> m (List1 a) Source # | |
TraverseDecl a => TraverseDecl (List2 a) Source # | |
Defined in Agda.Syntax.Concrete.Generic preTraverseDecl :: Monad m => (Declaration -> m Declaration) -> List2 a -> m (List2 a) Source # | |
TraverseDecl a => TraverseDecl [a] Source # | |
Defined in Agda.Syntax.Concrete.Generic preTraverseDecl :: Monad m => (Declaration -> m Declaration) -> [a] -> m [a] Source # |