Data.Generics.Schemes

| Haskell Hierarchical Libraries (base package) | Contents | Index
Data.Generics.Schemes |
Portability | non-portable
Stability | experimental
Maintainer | libraries@haskell.org
Description
"Scrap your boilerplate" --- Generic programming in Haskell See http://www.cs.vu.nl/boilerplate/. The present module provides frequently used generic traversal schemes.
Synopsis
everywhere :: (forall a . Data a => a -> a) -> forall a . Data a => a -> a
everywhere' :: (forall a . Data a => a -> a) -> forall a . Data a => a -> a
everywhereBut :: GenericQ Bool -> GenericT -> GenericT
everywhereM :: Monad m => GenericM m -> GenericM m
somewhere :: MonadPlus m => GenericM m -> GenericM m
everything :: (r -> r -> r) -> GenericQ r -> GenericQ r
listify :: Typeable r => (r -> Bool) -> GenericQ [r]
something :: GenericQ (Maybe u) -> GenericQ (Maybe u)
synthesize :: s -> (s -> s -> s) -> GenericQ (s -> s) -> GenericQ s
Documentation
everywhere :: (forall a . Data a => a -> a) -> forall a . Data a => a -> a
Apply a transformation everywhere in bottom-up manner
everywhere' :: (forall a . Data a => a -> a) -> forall a . Data a => a -> a
Apply a transformation everywhere in top-down manner
everywhereBut :: GenericQ Bool -> GenericT -> GenericT
Variation on everywhere with an extra stop condition
everywhereM :: Monad m => GenericM m -> GenericM m
Monadic variation on everywhere
somewhere :: MonadPlus m => GenericM m -> GenericM m
Apply a monadic transformation at least somewhere
everything :: (r -> r -> r) -> GenericQ r -> GenericQ r
Summarise all nodes in top-down, left-to-right order
listify :: Typeable r => (r -> Bool) -> GenericQ [r]
Get a list of all entities that meet a predicate
something :: GenericQ (Maybe u) -> GenericQ (Maybe u)
Look up a subterm by means of a maybe-typed filter
synthesize :: s -> (s -> s -> s) -> GenericQ (s -> s) -> GenericQ s
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 sythesised data according to the given term
Produced by Haddock version 0.6