Data.Generics.Geniplate

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

Safe Haskell | None
Language | Haskell98

Data.Generics.Geniplate

Synopsis

- genUniverseBi :: Name -> Q Exp
- genUniverseBi' :: TypeQ -> Q Exp
- genUniverseBiT :: [TypeQ] -> Name -> Q Exp
- genUniverseBiT' :: [TypeQ] -> TypeQ -> Q Exp
- genTransformBi :: Name -> Q Exp
- genTransformBi' :: TypeQ -> Q Exp
- genTransformBiT :: [TypeQ] -> Name -> Q Exp
- genTransformBiT' :: [TypeQ] -> TypeQ -> Q Exp
- genTransformBiM :: Name -> Q Exp
- genTransformBiM' :: TypeQ -> Q Exp
- genTransformBiMT :: [TypeQ] -> Name -> Q Exp
- genTransformBiMT' :: [TypeQ] -> TypeQ -> Q Exp
- class UniverseBi s t where
- universe :: UniverseBi a a => a -> [a]
- instanceUniverseBi :: TypeQ -> Q [Dec]
- instanceUniverseBiT :: [TypeQ] -> TypeQ -> Q [Dec]
- class TransformBi s t where
- transform :: TransformBi a a => (a -> a) -> a -> a
- instanceTransformBi :: TypeQ -> Q [Dec]
- instanceTransformBiT :: [TypeQ] -> TypeQ -> Q [Dec]
- class TransformBiM m s t where
- transformM :: TransformBiM m a a => (a -> m a) -> a -> m a
- instanceTransformBiM :: TypeQ -> TypeQ -> Q [Dec]
- instanceTransformBiMT :: [TypeQ] -> TypeQ -> TypeQ -> Q [Dec]
- class DescendBiM m s t where
- instanceDescendBiM :: TypeQ -> TypeQ -> Q [Dec]
- instanceDescendBiMT :: [TypeQ] -> TypeQ -> TypeQ -> Q [Dec]
- class DescendM m t where
- descend :: DescendM Identity a => (a -> a) -> a -> a
- instanceDescendM :: TypeQ -> TypeQ -> Q [Dec]
- instanceDescendMT :: [TypeQ] -> TypeQ -> TypeQ -> Q [Dec]

# Documentation

genUniverseBi #

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`.

genUniverseBi' :: TypeQ -> Q Exp #

genUniverseBiT #

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.

genUniverseBiT' :: [TypeQ] -> TypeQ -> Q Exp #

genTransformBi #

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.

genTransformBi' :: TypeQ -> Q Exp #

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

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

genTransformBiT' :: [TypeQ] -> TypeQ -> Q Exp #

genTransformBiM :: Name -> Q Exp #

genTransformBiM' :: TypeQ -> Q Exp #

genTransformBiMT :: [TypeQ] -> Name -> Q Exp #

genTransformBiMT' :: [TypeQ] -> TypeQ -> Q Exp #

class UniverseBi s t where #

Class for `universeBi`.

Minimal complete definition

universeBi

Methods

universeBi :: s -> [t] #

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

instanceUniverseBi #

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`.

instanceUniverseBiT #

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 #

Class for `transformBi`.

Minimal complete definition

transformBi

Methods

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

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

instanceTransformBi #

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`.

instanceTransformBiT #

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 #

Class for `transformBiM`.

Minimal complete definition

transformBiM

Methods

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

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

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

Create a `TransformBiM` instance.

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

Create a `TransformBiM` instance with certain types being abstract.

class DescendBiM m s t where #

Class for `descendBiM`.

Minimal complete definition

descendBiM

Methods

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

instanceDescendBiM :: TypeQ -> TypeQ -> Q [Dec] #

Create a `DescendBiM` instance.

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

Create a `DescendBiM` instance with certain types being abstract.

class DescendM m t where #

Class for `descendM`.

Minimal complete definition

descendM

Methods

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

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

instanceDescendM :: TypeQ -> TypeQ -> Q [Dec] #

Create a `DescendBiM` instance.

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

Create a `DescendBiM` instance with certain types being abstract.