Copyright | (c) The University of Pennsylvania 2006 |
---|---|

License | BSD |

Maintainer | sweirich@cis.upenn.edu |

Stability | experimental |

Portability | non-portable |

Safe Haskell | None |

Language | Haskell2010 |

- everywhere :: (forall a. Rep a => a -> a) -> forall a. Rep a => a -> a
- everywhere' :: (forall a. Rep a => a -> a) -> forall a. Rep a => a -> a
- everywhereBut :: GenericQ Bool -> GenericT -> GenericT
- everywhereM :: Monad m => GenericM m -> GenericM m
- everything :: (r -> r -> r) -> GenericQ r -> GenericQ r
- listify :: Rep r => (r -> Bool) -> GenericQ [r]
- something :: GenericQ (Maybe u) -> GenericQ (Maybe u)
- synthesize :: s -> (s -> s -> s) -> GenericQ (s -> s) -> GenericQ s
- gsize :: Rep a => a -> Int
- glength :: GenericQ Int
- gdepth :: GenericQ Int
- gcount :: GenericQ Bool -> GenericQ Int
- gnodecount :: GenericQ Int
- gtypecount :: Rep a => a -> GenericQ Int
- gfindtype :: (Rep x, Rep y) => x -> Maybe y

# Documentation

everywhere :: (forall a. Rep a => a -> a) -> forall a. Rep a => a -> a Source #

Apply a transformation everywhere in bottom-up manner

everywhere' :: (forall a. Rep a => a -> a) -> forall a. Rep a => a -> a Source #

Apply a transformation everywhere in top-down manner

everywhereBut :: GenericQ Bool -> GenericT -> GenericT Source #

Variation on everywhere with an extra stop condition

everything :: (r -> r -> r) -> GenericQ r -> GenericQ r Source #

Apply a monadic transformation at least somewhere somewhere :: MonadPlus m => GenericM m -> GenericM m

Summarise all nodes in top-down, left-to-right order

listify :: Rep r => (r -> Bool) -> GenericQ [r] Source #

Get a list of all entities that meet a predicate

something :: GenericQ (Maybe u) -> GenericQ (Maybe u) Source #

Look up a subterm by means of a maybe-typed filter

synthesize :: s -> (s -> s -> s) -> GenericQ (s -> s) -> GenericQ s Source #

Bottom-up synthesis of a data structure; 1st argument z is the initial element for the synthesis; 2nd argument o is for reduction of results from subterms; 3rd argument f updates the synthesised data according to the given term

gcount :: GenericQ Bool -> GenericQ Int Source #

Determine the number of all suitable nodes in a given term

gnodecount :: GenericQ Int Source #

Determine the number of all nodes in a given term