generic-deriving-1.12.2: Generic programming library for generalised deriving.

Copyright2011-2012 Universiteit Utrecht University of Oxford
LicenseBSD3
Maintainergenerics@haskell.org
Stabilityexperimental
Portabilitynon-portable
Safe HaskellTrustworthy
LanguageHaskell2010

Generics.Deriving.Uniplate

Contents

Description

Summary: Functions inspired by the Uniplate generic programming library, mostly implemented by Sean Leather.

Synopsis

Generic Uniplate class

class Uniplate a where Source #

Methods

children :: a -> [a] Source #

children :: (Generic a, Uniplate' (Rep a) a) => a -> [a] Source #

context :: a -> [a] -> a Source #

context :: (Generic a, Context' (Rep a) a) => a -> [a] -> a Source #

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

descend :: (Generic a, Uniplate' (Rep a) a) => (a -> a) -> a -> a Source #

descendM :: Monad m => (a -> m a) -> a -> m a Source #

descendM :: (Generic a, Uniplate' (Rep a) a, Monad m) => (a -> m a) -> a -> m a Source #

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

transform :: (Generic a, Uniplate' (Rep a) a) => (a -> a) -> a -> a Source #

transformM :: Monad m => (a -> m a) -> a -> m a Source #

transformM :: (Generic a, Uniplate' (Rep a) a, Monad m) => (a -> m a) -> a -> m a Source #

Instances

Uniplate Bool Source # 

Methods

children :: Bool -> [Bool] Source #

context :: Bool -> [Bool] -> Bool Source #

descend :: (Bool -> Bool) -> Bool -> Bool Source #

descendM :: Monad m => (Bool -> m Bool) -> Bool -> m Bool Source #

transform :: (Bool -> Bool) -> Bool -> Bool Source #

transformM :: Monad m => (Bool -> m Bool) -> Bool -> m Bool Source #

Uniplate Char Source # 

Methods

children :: Char -> [Char] Source #

context :: Char -> [Char] -> Char Source #

descend :: (Char -> Char) -> Char -> Char Source #

descendM :: Monad m => (Char -> m Char) -> Char -> m Char Source #

transform :: (Char -> Char) -> Char -> Char Source #

transformM :: Monad m => (Char -> m Char) -> Char -> m Char Source #

Uniplate Double Source # 
Uniplate Float Source # 
Uniplate Int Source # 

Methods

children :: Int -> [Int] Source #

context :: Int -> [Int] -> Int Source #

descend :: (Int -> Int) -> Int -> Int Source #

descendM :: Monad m => (Int -> m Int) -> Int -> m Int Source #

transform :: (Int -> Int) -> Int -> Int Source #

transformM :: Monad m => (Int -> m Int) -> Int -> m Int Source #

Uniplate () Source # 

Methods

children :: () -> [()] Source #

context :: () -> [()] -> () Source #

descend :: (() -> ()) -> () -> () Source #

descendM :: Monad m => (() -> m ()) -> () -> m () Source #

transform :: (() -> ()) -> () -> () Source #

transformM :: Monad m => (() -> m ()) -> () -> m () Source #

Uniplate [a] Source # 

Methods

children :: [a] -> [[a]] Source #

context :: [a] -> [[a]] -> [a] Source #

descend :: ([a] -> [a]) -> [a] -> [a] Source #

descendM :: Monad m => ([a] -> m [a]) -> [a] -> m [a] Source #

transform :: ([a] -> [a]) -> [a] -> [a] Source #

transformM :: Monad m => ([a] -> m [a]) -> [a] -> m [a] Source #

Uniplate (Maybe a) Source # 

Methods

children :: Maybe a -> [Maybe a] Source #

context :: Maybe a -> [Maybe a] -> Maybe a Source #

descend :: (Maybe a -> Maybe a) -> Maybe a -> Maybe a Source #

descendM :: Monad m => (Maybe a -> m (Maybe a)) -> Maybe a -> m (Maybe a) Source #

transform :: (Maybe a -> Maybe a) -> Maybe a -> Maybe a Source #

transformM :: Monad m => (Maybe a -> m (Maybe a)) -> Maybe a -> m (Maybe a) Source #

Uniplate (Either a b) Source # 

Methods

children :: Either a b -> [Either a b] Source #

context :: Either a b -> [Either a b] -> Either a b Source #

descend :: (Either a b -> Either a b) -> Either a b -> Either a b Source #

descendM :: Monad m => (Either a b -> m (Either a b)) -> Either a b -> m (Either a b) Source #

transform :: (Either a b -> Either a b) -> Either a b -> Either a b Source #

transformM :: Monad m => (Either a b -> m (Either a b)) -> Either a b -> m (Either a b) Source #

Uniplate (b, c) Source # 

Methods

children :: (b, c) -> [(b, c)] Source #

context :: (b, c) -> [(b, c)] -> (b, c) Source #

descend :: ((b, c) -> (b, c)) -> (b, c) -> (b, c) Source #

descendM :: Monad m => ((b, c) -> m (b, c)) -> (b, c) -> m (b, c) Source #

transform :: ((b, c) -> (b, c)) -> (b, c) -> (b, c) Source #

transformM :: Monad m => ((b, c) -> m (b, c)) -> (b, c) -> m (b, c) Source #

Uniplate (b, c, d) Source # 

Methods

children :: (b, c, d) -> [(b, c, d)] Source #

context :: (b, c, d) -> [(b, c, d)] -> (b, c, d) Source #

descend :: ((b, c, d) -> (b, c, d)) -> (b, c, d) -> (b, c, d) Source #

descendM :: Monad m => ((b, c, d) -> m (b, c, d)) -> (b, c, d) -> m (b, c, d) Source #

transform :: ((b, c, d) -> (b, c, d)) -> (b, c, d) -> (b, c, d) Source #

transformM :: Monad m => ((b, c, d) -> m (b, c, d)) -> (b, c, d) -> m (b, c, d) Source #

Uniplate (b, c, d, e) Source # 

Methods

children :: (b, c, d, e) -> [(b, c, d, e)] Source #

context :: (b, c, d, e) -> [(b, c, d, e)] -> (b, c, d, e) Source #

descend :: ((b, c, d, e) -> (b, c, d, e)) -> (b, c, d, e) -> (b, c, d, e) Source #

descendM :: Monad m => ((b, c, d, e) -> m (b, c, d, e)) -> (b, c, d, e) -> m (b, c, d, e) Source #

transform :: ((b, c, d, e) -> (b, c, d, e)) -> (b, c, d, e) -> (b, c, d, e) Source #

transformM :: Monad m => ((b, c, d, e) -> m (b, c, d, e)) -> (b, c, d, e) -> m (b, c, d, e) Source #

Uniplate (b, c, d, e, f) Source # 

Methods

children :: (b, c, d, e, f) -> [(b, c, d, e, f)] Source #

context :: (b, c, d, e, f) -> [(b, c, d, e, f)] -> (b, c, d, e, f) Source #

descend :: ((b, c, d, e, f) -> (b, c, d, e, f)) -> (b, c, d, e, f) -> (b, c, d, e, f) Source #

descendM :: Monad m => ((b, c, d, e, f) -> m (b, c, d, e, f)) -> (b, c, d, e, f) -> m (b, c, d, e, f) Source #

transform :: ((b, c, d, e, f) -> (b, c, d, e, f)) -> (b, c, d, e, f) -> (b, c, d, e, f) Source #

transformM :: Monad m => ((b, c, d, e, f) -> m (b, c, d, e, f)) -> (b, c, d, e, f) -> m (b, c, d, e, f) Source #

Uniplate (b, c, d, e, f, g) Source # 

Methods

children :: (b, c, d, e, f, g) -> [(b, c, d, e, f, g)] Source #

context :: (b, c, d, e, f, g) -> [(b, c, d, e, f, g)] -> (b, c, d, e, f, g) Source #

descend :: ((b, c, d, e, f, g) -> (b, c, d, e, f, g)) -> (b, c, d, e, f, g) -> (b, c, d, e, f, g) Source #

descendM :: Monad m => ((b, c, d, e, f, g) -> m (b, c, d, e, f, g)) -> (b, c, d, e, f, g) -> m (b, c, d, e, f, g) Source #

transform :: ((b, c, d, e, f, g) -> (b, c, d, e, f, g)) -> (b, c, d, e, f, g) -> (b, c, d, e, f, g) Source #

transformM :: Monad m => ((b, c, d, e, f, g) -> m (b, c, d, e, f, g)) -> (b, c, d, e, f, g) -> m (b, c, d, e, f, g) Source #

Uniplate (b, c, d, e, f, g, h) Source # 

Methods

children :: (b, c, d, e, f, g, h) -> [(b, c, d, e, f, g, h)] Source #

context :: (b, c, d, e, f, g, h) -> [(b, c, d, e, f, g, h)] -> (b, c, d, e, f, g, h) Source #

descend :: ((b, c, d, e, f, g, h) -> (b, c, d, e, f, g, h)) -> (b, c, d, e, f, g, h) -> (b, c, d, e, f, g, h) Source #

descendM :: Monad m => ((b, c, d, e, f, g, h) -> m (b, c, d, e, f, g, h)) -> (b, c, d, e, f, g, h) -> m (b, c, d, e, f, g, h) Source #

transform :: ((b, c, d, e, f, g, h) -> (b, c, d, e, f, g, h)) -> (b, c, d, e, f, g, h) -> (b, c, d, e, f, g, h) Source #

transformM :: Monad m => ((b, c, d, e, f, g, h) -> m (b, c, d, e, f, g, h)) -> (b, c, d, e, f, g, h) -> m (b, c, d, e, f, g, h) Source #

Derived functions

uniplate :: Uniplate a => a -> ([a], [a] -> a) Source #

universe :: Uniplate a => a -> [a] Source #

rewrite :: Uniplate a => (a -> Maybe a) -> a -> a Source #

rewriteM :: (Monad m, Uniplate a) => (a -> m (Maybe a)) -> a -> m a Source #

contexts :: Uniplate a => a -> [(a, a -> a)] Source #

holes :: Uniplate a => a -> [(a, a -> a)] Source #

para :: Uniplate a => (a -> [r] -> r) -> a -> r Source #

Default definitions

childrendefault :: (Generic a, Uniplate' (Rep a) a) => a -> [a] Source #

contextdefault :: (Generic a, Context' (Rep a) a) => a -> [a] -> a Source #

descenddefault :: (Generic a, Uniplate' (Rep a) a) => (a -> a) -> a -> a Source #

descendMdefault :: (Generic a, Uniplate' (Rep a) a, Monad m) => (a -> m a) -> a -> m a Source #

transformdefault :: (Generic a, Uniplate' (Rep a) a) => (a -> a) -> a -> a Source #

transformMdefault :: (Generic a, Uniplate' (Rep a) a, Monad m) => (a -> m a) -> a -> m a Source #

Internal Uniplate class

class Uniplate' f b where Source #

Minimal complete definition

children', descend', descendM', transform', transformM'

Methods

children' :: f a -> [b] Source #

descend' :: (b -> b) -> f a -> f a Source #

descendM' :: Monad m => (b -> m b) -> f a -> m (f a) Source #

transform' :: (b -> b) -> f a -> f a Source #

transformM' :: Monad m => (b -> m b) -> f a -> m (f a) Source #

Instances

Uniplate' k (U1 k) a Source # 

Methods

children' :: a a -> [b] Source #

descend' :: (b -> b) -> a a -> a a Source #

descendM' :: Monad m => (b -> m b) -> a a -> m (a a) Source #

transform' :: (b -> b) -> a a -> a a Source #

transformM' :: Monad m => (b -> m b) -> a a -> m (a a) Source #

(Uniplate' k f b, Uniplate' k g b) => Uniplate' k ((:*:) k f g) b Source # 

Methods

children' :: b a -> [b] Source #

descend' :: (b -> b) -> b a -> b a Source #

descendM' :: Monad m => (b -> m b) -> b a -> m (b a) Source #

transform' :: (b -> b) -> b a -> b a Source #

transformM' :: Monad m => (b -> m b) -> b a -> m (b a) Source #

(Uniplate' k f b, Uniplate' k g b) => Uniplate' k ((:+:) k f g) b Source # 

Methods

children' :: b a -> [b] Source #

descend' :: (b -> b) -> b a -> b a Source #

descendM' :: Monad m => (b -> m b) -> b a -> m (b a) Source #

transform' :: (b -> b) -> b a -> b a Source #

transformM' :: Monad m => (b -> m b) -> b a -> m (b a) Source #

Uniplate' k (K1 k i a) b Source # 

Methods

children' :: b a -> [b] Source #

descend' :: (b -> b) -> b a -> b a Source #

descendM' :: Monad m => (b -> m b) -> b a -> m (b a) Source #

transform' :: (b -> b) -> b a -> b a Source #

transformM' :: Monad m => (b -> m b) -> b a -> m (b a) Source #

Uniplate a => Uniplate' k (K1 k i a) a Source # 

Methods

children' :: a a -> [b] Source #

descend' :: (b -> b) -> a a -> a a Source #

descendM' :: Monad m => (b -> m b) -> a a -> m (a a) Source #

transform' :: (b -> b) -> a a -> a a Source #

transformM' :: Monad m => (b -> m b) -> a a -> m (a a) Source #

Uniplate' k f b => Uniplate' k (M1 k i c f) b Source # 

Methods

children' :: b a -> [b] Source #

descend' :: (b -> b) -> b a -> b a Source #

descendM' :: Monad m => (b -> m b) -> b a -> m (b a) Source #

transform' :: (b -> b) -> b a -> b a Source #

transformM' :: Monad m => (b -> m b) -> b a -> m (b a) Source #