Strafunski-StrategyLib-5.0.0.9: Library for strategic programming

MaintainerRalf Laemmel, Joost Visser
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell98

Data.Generics.Strafunski.StrategyLib.PathTheme

Contents

Description

This module is part of StrategyLib, a library of functional strategy combinators, including combinators for generic traversal. In this module, we define path combinator to constrain selection and transformation of nodes or subtrees by path conditions.

Synopsis

Below

Strictly below

belowS :: (MonadPlus m, Strategy s m, StrategyPlus s m) => s m -> TU () m -> s m Source #

Select or transform a node below a node where a condition holds. We find the top-most node which admits selection or transformation below the top-most node which meets the condition. Thus, the distance between guard and application node is minimized.

Below or at the same height

beloweqS :: (MonadPlus m, Strategy s m, StrategyPlus s m) => s m -> TU () m -> s m Source #

Select or transform a node below or at a node where a condition holds.

Type-specialised versions

belowTP :: MonadPlus m => TP m -> TU () m -> TP m Source #

Apply a transformation strictly below a node where a condition holds.

beloweqTP :: MonadPlus m => TP m -> TU () m -> TP m Source #

Apply a transformation below or at a node where a condition holds.

Above

Strictly above

aboveS :: (MonadPlus m, Strategy s m, StrategyPlus s m) => s m -> TU () m -> s m Source #

Select or transform a node above a node where a condition holds. The distance between guard and application node is minimized.

Above or at the same height

aboveeqS :: (MonadPlus m, Strategy s m, StrategyPlus s m) => s m -> TU () m -> s m Source #

Select or transform a node above or at a node where a condition holds.

Type-specialised versions

aboveTP :: MonadPlus m => TP m -> TU () m -> TP m Source #

Apply a transformation strictly above a node where a condition holds.

aboveeqTP :: MonadPlus m => TP m -> TU () m -> TP m Source #

Apply a transformation above or at a node where a condition holds.