Copyright | 2011-2012 Universiteit Utrecht University of Oxford |
---|---|

License | BSD3 |

Maintainer | generics@haskell.org |

Stability | experimental |

Portability | non-portable |

Safe Haskell | Trustworthy |

Language | Haskell2010 |

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

- class Uniplate a where
- uniplate :: Uniplate a => a -> ([a], [a] -> a)
- universe :: Uniplate a => a -> [a]
- rewrite :: Uniplate a => (a -> Maybe a) -> a -> a
- rewriteM :: (Monad m, Uniplate a) => (a -> m (Maybe a)) -> a -> m a
- contexts :: Uniplate a => a -> [(a, a -> a)]
- holes :: Uniplate a => a -> [(a, a -> a)]
- para :: Uniplate a => (a -> [r] -> r) -> a -> r
- childrendefault :: (Generic a, Uniplate' (Rep a) a) => a -> [a]
- contextdefault :: (Generic a, Context' (Rep a) a) => a -> [a] -> a
- descenddefault :: (Generic a, Uniplate' (Rep a) a) => (a -> a) -> a -> a
- descendMdefault :: (Generic a, Uniplate' (Rep a) a, Monad m) => (a -> m a) -> a -> m a
- transformdefault :: (Generic a, Uniplate' (Rep a) a) => (a -> a) -> a -> a
- transformMdefault :: (Generic a, Uniplate' (Rep a) a, Monad m) => (a -> m a) -> a -> m a
- class Uniplate' f b where

# Generic Uniplate class

class Uniplate a where 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 #

Uniplate Bool Source # | |

Uniplate Char Source # | |

Uniplate Double Source # | |

Uniplate Float Source # | |

Uniplate Int Source # | |

Uniplate () Source # | |

Uniplate [a] Source # | |

Uniplate (Maybe a) Source # | |

Uniplate (Either a b) Source # | |

Uniplate (b, c) Source # | |

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

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

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

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

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

# Derived functions

# Default definitions

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

# Internal Uniplate class

class Uniplate' f b where Source #

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 #

Uniplate' k (U1 k) a Source # | |

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

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

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

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

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