Safe Haskell | None |
---|---|
Language | Haskell98 |
Data.Generics.PlateTypeable
Description
Deprecated: Use Data.Generics.Uniplate.Typeable instead
DEPRECATED: Use Data.Generics.Uniplate.Typeable instead.
This module supplies a method for writing Biplate
instances more easily.
To take an example:
data Expr = Var Int | Neg Expr | Add Expr Expr instance Typeable Expr where ... instance (Typeable a, Uniplate a) => PlateAll Expr a where plateAll (Var x ) = plate Var |- x plateAll (Neg x ) = plate Neg |+ x plateAll (Add x y) = plate Add |+ x |+ y instance Uniplate Expr where uniplate = uniplateAll
Synopsis
- module Data.Generics.Biplate
- class PlateAll from to where
- plateAll :: from -> Type from to
- uniplateAll :: PlateAll a b => a -> (Str b, Str b -> a)
- plate :: from -> Type from to
- (|+) :: (Typeable item, Typeable to, PlateAll item to) => Type (item -> from) to -> item -> Type from to
- (|-) :: Type (item -> from) to -> item -> Type from to
Documentation
module Data.Generics.Biplate
The Class
class PlateAll from to where Source #
This class represents going from the container type to the target.
Instances
PlateAll Bool to Source # | |
Defined in Data.Generics.PlateTypeable | |
PlateAll Char to Source # | |
Defined in Data.Generics.PlateTypeable | |
PlateAll Double to Source # | |
Defined in Data.Generics.PlateTypeable | |
PlateAll Float to Source # | |
Defined in Data.Generics.PlateTypeable | |
PlateAll Int to Source # | |
Defined in Data.Generics.PlateTypeable | |
PlateAll Integer to Source # | |
Defined in Data.Generics.PlateTypeable | |
PlateAll () to Source # | |
Defined in Data.Generics.PlateTypeable | |
(PlateAll from to, Typeable from, Typeable to, Uniplate to) => PlateAll [from] to Source # | |
Defined in Data.Generics.PlateTypeable | |
(PlateAll from to, Typeable from, Typeable to, Uniplate to) => PlateAll (Maybe from) to Source # | |
Defined in Data.Generics.PlateTypeable | |
(PlateAll a to, Typeable a, PlateAll b to, Typeable b, Typeable to, Uniplate to) => PlateAll (Either a b) to Source # | |
Defined in Data.Generics.PlateTypeable | |
(PlateAll a to, Typeable a, PlateAll b to, Typeable b, Typeable to, Uniplate to) => PlateAll (a, b) to Source # | |
Defined in Data.Generics.PlateTypeable | |
(PlateAll a to, Typeable a, PlateAll b to, Typeable b, PlateAll c to, Typeable c, Typeable to, Uniplate to) => PlateAll (a, b, c) to Source # | |
Defined in Data.Generics.PlateTypeable | |
(PlateAll a to, Typeable a, PlateAll b to, Typeable b, PlateAll c to, Typeable c, PlateAll d to, Typeable d, Typeable to, Uniplate to) => PlateAll (a, b, c, d) to Source # | |
Defined in Data.Generics.PlateTypeable | |
(PlateAll a to, Typeable a, PlateAll b to, Typeable b, PlateAll c to, Typeable c, PlateAll d to, Typeable d, PlateAll e to, Typeable e, Typeable to, Uniplate to) => PlateAll (a, b, c, d, e) to Source # | |
Defined in Data.Generics.PlateTypeable |
The Combinators
plate :: from -> Type from to Source #
The main combinator used to start the chain.
The following rule can be used for optimisation:
plate Ctor |- x == plate (Ctor x)
(|+) :: (Typeable item, Typeable to, PlateAll item to) => Type (item -> from) to -> item -> Type from to Source #
the field to the right may contain the target.
(|-) :: Type (item -> from) to -> item -> Type from to Source #
The field to the right does not contain the target. This can be used as either an optimisation, or more commonly for excluding primitives such as Int.
Orphan instances
Uniplate Bool Source # | |
Methods uniplate :: UniplateType Bool Source # | |
Uniplate Char Source # | |
Methods uniplate :: UniplateType Char Source # | |
Uniplate Double Source # | |
Methods uniplate :: UniplateType Double Source # | |
Uniplate Float Source # | |
Methods uniplate :: UniplateType Float Source # | |
Uniplate Int Source # | |
Methods uniplate :: UniplateType Int Source # | |
Uniplate Integer Source # | |
Methods uniplate :: UniplateType Integer Source # | |
Uniplate () Source # | |
Methods uniplate :: UniplateType () Source # | |
(Typeable a, Typeable b, Uniplate b, PlateAll a b) => Biplate a b Source # | |
Methods biplate :: BiplateType a b Source # |