geniplate-0.6.0.3: Use template Haskell to generate Uniplate-like functions.

Safe HaskellNone

Data.Generics.Geniplate

Synopsis

Documentation

genUniverseBiSource

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.

genUniverseBiTSource

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.

genTransformBiSource

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 ExpSource

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

class UniverseBi s t whereSource

Class for universeBi.

Methods

universeBi :: s -> [t]Source

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

instanceUniverseBiSource

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.

instanceUniverseBiTSource

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 whereSource

Class for transformBi.

Methods

transformBi :: (s -> s) -> t -> tSource

transform :: TransformBi a a => (a -> a) -> a -> aSource

instanceTransformBiSource

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.

instanceTransformBiTSource

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 whereSource

Class for transformBiM.

Methods

transformBiM :: (s -> m s) -> t -> m tSource

transformM :: TransformBiM m a a => (a -> m a) -> a -> m aSource

instanceTransformBiM :: TypeQ -> TypeQ -> Q [Dec]Source

Create a TransformBiM instance.

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

Create a TransformBiM instance with certain types being abstract.