rewriting-0.2.2: Generic rewriting library for regular datatypes.

Portabilitynon-portable
Stabilityexperimental
Maintainergenerics@haskell.org
Safe HaskellSafe-Infered

Generics.Regular.Rewriting.Strategies

Contents

Description

Summary: Generic functions for traversal strategies.

Synopsis

Apply a function to the children of a value.

once :: (Regular a, GMap (PF a), Functor m, MonadPlus m) => (a -> m a) -> a -> m aSource

Applies a function to the first subtree (possibly the tree itself) on which it succeeds, using a preorder traversal.

one :: (Regular a, GMap (PF a), Functor m, MonadPlus m) => (a -> m a) -> a -> m aSource

Applies a function to the first immediate child of a value on which it succeeds.

Apply a (monadic) function exhaustively top-down.

topdownM :: (Regular a, GMap (PF a), Functor m, Monad m) => (a -> m a) -> a -> m aSource

Applies a monadic function exhaustively in a top-down fashion.

topdown :: (Regular a, Functor (PF a)) => (a -> a) -> a -> aSource

Applies a function exhaustively in a top-down fashion

Apply a (monadic) function exhaustively bottom-up.

bottomupM :: (Regular a, GMap (PF a), Functor m, Monad m) => (a -> m a) -> a -> m aSource

Applies a monadic function exhaustively in a bottom-up fashion.

bottomup :: (Regular a, Functor (PF a)) => (a -> a) -> a -> aSource

Applies a function exhaustively in a bottom-up fashion

Apply a (monadic) function to immediate children.

composM :: (Regular a, GMap (PF a), Functor m, Monad m) => (a -> m a) -> a -> m aSource

Applies a monadic function to all the immediate children of a value.

compos :: (Regular a, Functor (PF a)) => (a -> a) -> a -> aSource

Applies a function to all the immediate children of a value.