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

License | BSD3 |

Maintainer | generics@haskell.org |

Stability | experimental |

Portability | non-portable |

Safe Haskell | None |

Language | Haskell98 |

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

# Documentation

Nothing

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 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

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