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

Safe Haskell | Safe-Inferred
Language | Haskell2010

Data.Generics.SYB

Description

SYB compatibility layer. This module serves as a drop-in replacement in some situations for some of the SYB operations. Users should also import Data.Generics.Uniplate.Data.

SYB is described in the paper: "Scrap your boilerplate: a practical design pattern for generic programming" by Ralf Lammel and Simon Peyton Jones.

- http://www.cs.vu.nl/boilerplate/
- http://doi.acm.org/10.1145/604174.604179
- http://www.cs.vu.nl/boilerplate/tldi03.pdf

Synopsis

- gmapT :: Uniplate a => (a -> a) -> a -> a
- gmapQl :: Uniplate a => (r -> r' -> r) -> r -> (a -> r') -> a -> r
- gmapQr :: Uniplate a => (r' -> r -> r) -> r -> (a -> r') -> a -> r
- gmapQ :: Uniplate a => (a -> u) -> a -> [u]
- gmapQi :: Uniplate a => Int -> (a -> u) -> a -> u
- gmapM :: (Uniplate a, Applicative m) => (a -> m a) -> a -> m a
- mkT :: (a -> a) -> a -> a
- everywhere :: Biplate b a => (a -> a) -> b -> b
- mkM :: (a -> m a) -> a -> m a
- everywhereM :: (Biplate b a, Monad m, Applicative m) => (a -> m a) -> b -> m b
- mkQ :: r -> (a -> r) -> (r, a -> r)
- everything :: Biplate b a => (r -> r -> r) -> (r, a -> r) -> b -> r

# Documentation

gmapT :: Uniplate a => (a -> a) -> a -> a Source #

    gmapT == descend

gmapQl :: Uniplate a => (r -> r' -> r) -> r -> (a -> r') -> a -> r Source #

Use `children` and `foldl`

gmapQr :: Uniplate a => (r' -> r -> r) -> r -> (a -> r') -> a -> r Source #

Use `children` and `foldr`

gmapQ :: Uniplate a => (a -> u) -> a -> [u] Source #

Use `children`

gmapQi :: Uniplate a => Int -> (a -> u) -> a -> u Source #

Use `children` and `!!`

gmapM :: (Uniplate a, Applicative m) => (a -> m a) -> a -> m a Source #

    gmapM == descendM

mkT :: (a -> a) -> a -> a Source #

    mkT == id

everywhere :: Biplate b a => (a -> a) -> b -> b Source #

    everywhere == transformBi

mkM :: (a -> m a) -> a -> m a Source #

    mkM == id

everywhereM :: (Biplate b a, Monad m, Applicative m) => (a -> m a) -> b -> m b Source #

    everywhereM == transformBiM

mkQ :: r -> (a -> r) -> (r, a -> r) Source #

Only for use with `everything`

everything :: Biplate b a => (r -> r -> r) -> (r, a -> r) -> b -> r Source #

Use `universe` or `universeBi`, perhaps followed by a fold.

Not an exact equivalent to the SYB `everything`, as the operators may be applied in different orders.