geniplate-mirror-0.7.4: Use Template Haskell to generate Uniplate-like functions.

Data.Generics.Geniplate

Synopsis

# Documentation

Arguments

 :: Name function of type S -> [T] -> Q Exp

Generate TH code for a function that extracts all subparts of a certain type. The argument to genUniverseBi is a name with the type S -> [T], for some types S and T. The function will extract all subparts of type T from S.

Arguments

 :: [TypeQ] types not touched by universeBi -> Name function of type S -> [T] -> Q Exp

Same as genUniverseBi, but does not look inside any types mention in the list of types.

Arguments

 :: Name function of type (S->S) -> T -> T -> Q Exp

Generate TH code for a function that transforms all subparts of a certain type. The argument to genTransformBi is a name with the type (S->S) -> T -> T, for some types S and T. The function will transform all subparts of type S inside T using the given function.

genTransformBiT :: [TypeQ] -> Name -> Q Exp Source #

Same as genTransformBi, but does not look inside any types mention in the list of types.

class UniverseBi s t where Source #

Class for universeBi.

Minimal complete definition

universeBi

Methods

universeBi :: s -> [t] Source #

universe :: UniverseBi a a => a -> [a] Source #

Arguments

 :: TypeQ (source, target) types -> Q [Dec]

Create a UniverseBi instance. The TypeQ argument should be a pair; the source and target types for universeBi.

Arguments

 :: [TypeQ] types not touched by universeBi -> TypeQ (source, target) types -> Q [Dec]

Create a UniverseBi instance with certain types being abstract. The TypeQ argument should be a pair; the source and target types for universeBi.

class TransformBi s t where Source #

Class for transformBi.

Minimal complete definition

transformBi

Methods

transformBi :: (s -> s) -> t -> t Source #

transform :: TransformBi a a => (a -> a) -> a -> a Source #

Arguments

 :: TypeQ (inner, outer) types -> Q [Dec]

Create a TransformBi instance. The TypeQ argument should be a pair; the inner and outer types for transformBi.

Arguments

 :: [TypeQ] types not touched by transformBi -> TypeQ (inner, outer) types -> Q [Dec]

Create a TransformBi instance with certain types being abstract. The TypeQ argument should be a pair; the inner and outer types for transformBi.

class TransformBiM m s t where Source #

Class for transformBiM.

Minimal complete definition

transformBiM

Methods

transformBiM :: (s -> m s) -> t -> m t Source #

transformM :: TransformBiM m a a => (a -> m a) -> a -> m a Source #

Create a TransformBiM instance.

instanceTransformBiMT :: [TypeQ] -> TypeQ -> TypeQ -> Q [Dec] Source #

Create a TransformBiM instance with certain types being abstract.

class DescendBiM m s t where Source #

Class for descendBiM.

Minimal complete definition

descendBiM

Methods

descendBiM :: (s -> m s) -> t -> m t Source #

Create a DescendBiM instance.

instanceDescendBiMT :: [TypeQ] -> TypeQ -> TypeQ -> Q [Dec] Source #

Create a DescendBiM instance with certain types being abstract.

class DescendM m t where Source #

Class for descendM.

Minimal complete definition

descendM

Methods

descendM :: (t -> m t) -> t -> m t Source #

descend :: DescendM Identity a => (a -> a) -> a -> a Source #

Create a DescendBiM instance.

instanceDescendMT :: [TypeQ] -> TypeQ -> TypeQ -> Q [Dec] Source #

Create a DescendBiM instance with certain types being abstract.