uniplate-1.6.13: Help writing simple, concise and fast generic operations.
Safe HaskellNone
LanguageHaskell2010

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

Documentation

The Class

class PlateAll from to where Source #

This class represents going from the container type to the target.

This class should only be constructed with plate, |+ and |-

Methods

plateAll :: from -> Type from to Source #

Instances

Instances details
PlateAll Bool to Source # 
Instance details

Defined in Data.Generics.PlateTypeable

Methods

plateAll :: Bool -> Type Bool to Source #

PlateAll Char to Source # 
Instance details

Defined in Data.Generics.PlateTypeable

Methods

plateAll :: Char -> Type Char to Source #

PlateAll Double to Source # 
Instance details

Defined in Data.Generics.PlateTypeable

Methods

plateAll :: Double -> Type Double to Source #

PlateAll Float to Source # 
Instance details

Defined in Data.Generics.PlateTypeable

Methods

plateAll :: Float -> Type Float to Source #

PlateAll Int to Source # 
Instance details

Defined in Data.Generics.PlateTypeable

Methods

plateAll :: Int -> Type Int to Source #

PlateAll Integer to Source # 
Instance details

Defined in Data.Generics.PlateTypeable

Methods

plateAll :: Integer -> Type Integer to Source #

PlateAll () to Source # 
Instance details

Defined in Data.Generics.PlateTypeable

Methods

plateAll :: () -> Type () to Source #

(PlateAll from to, Typeable from, Typeable to, Uniplate to) => PlateAll [from] to Source # 
Instance details

Defined in Data.Generics.PlateTypeable

Methods

plateAll :: [from] -> Type [from] to Source #

(PlateAll from to, Typeable from, Typeable to, Uniplate to) => PlateAll (Maybe from) to Source # 
Instance details

Defined in Data.Generics.PlateTypeable

Methods

plateAll :: Maybe from -> Type (Maybe from) to Source #

(PlateAll a to, Typeable a, PlateAll b to, Typeable b, Typeable to, Uniplate to) => PlateAll (Either a b) to Source # 
Instance details

Defined in Data.Generics.PlateTypeable

Methods

plateAll :: Either a b -> Type (Either a b) to Source #

(PlateAll a to, Typeable a, PlateAll b to, Typeable b, Typeable to, Uniplate to) => PlateAll (a, b) to Source # 
Instance details

Defined in Data.Generics.PlateTypeable

Methods

plateAll :: (a, b) -> Type (a, b) to Source #

(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 # 
Instance details

Defined in Data.Generics.PlateTypeable

Methods

plateAll :: (a, b, c) -> Type (a, b, c) to Source #

(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 # 
Instance details

Defined in Data.Generics.PlateTypeable

Methods

plateAll :: (a, b, c, d) -> Type (a, b, c, d) to Source #

(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 # 
Instance details

Defined in Data.Generics.PlateTypeable

Methods

plateAll :: (a, b, c, d, e) -> Type (a, b, c, d, e) to Source #

uniplateAll :: PlateAll a b => a -> (Str b, Str b -> a) Source #

This function is used to write a Uniplate instance from a PlateAll one

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 # 
Instance details

Uniplate Char Source # 
Instance details

Uniplate Double Source # 
Instance details

Uniplate Float Source # 
Instance details

Uniplate Int Source # 
Instance details

Uniplate Integer Source # 
Instance details

Uniplate () Source # 
Instance details

(Typeable a, Typeable b, Uniplate b, PlateAll a b) => Biplate a b Source # 
Instance details

Methods

biplate :: BiplateType a b Source #