Safe Haskell | None |
---|---|
Language | Haskell2010 |
Wrappers and common functionality for classyplates
Synopsis
- class MonoMatch a b where
- monoApp :: (a -> a) -> b -> b
- type family TypEq a b :: Bool where ...
- descend :: forall c b. ClassyPlate c b => (forall a. (ClassyPlate c a, c a) => a -> a) -> b -> b
- descendM :: forall c b m. (ClassyPlate c b, Monad m) => (forall a. (ClassyPlate c a, c a) => a -> m a) -> b -> m b
- topDown :: forall c b. ClassyPlate c b => (forall a. (ClassyPlate c a, c a) => a -> a) -> b -> b
- topDownM :: forall c b m. (ClassyPlate c b, Monad m) => (forall a. (ClassyPlate c a, c a) => a -> m a) -> b -> m b
- bottomUp :: forall c b. ClassyPlate c b => (forall a. (ClassyPlate c a, c a) => a -> a) -> b -> b
- bottomUpM :: forall c b m. (ClassyPlate c b, Monad m) => (forall a. (ClassyPlate c a, c a) => a -> m a) -> b -> m b
- selectiveTraverse :: forall c b. ClassyPlate c b => (forall a. (ClassyPlate c a, c a) => a -> (a, Bool)) -> b -> b
- selectiveTraverseM :: forall c b m. (Monad m, ClassyPlate c b) => (forall a. (ClassyPlate c a, c a) => a -> m (a, Bool)) -> b -> m b
- smartTraverse :: forall c b. SmartClassyPlate c (ClassIgnoresSubtree c b) b => (forall a. (ClassyPlate c a, c a) => a -> a) -> b -> b
- smartTraverseM :: forall c b m. (SmartClassyPlate c (ClassIgnoresSubtree c b) b, Monad m) => (forall a. (ClassyPlate c a, c a) => a -> m a) -> b -> m b
Documentation
class MonoMatch a b where Source #
A class for the simple case when the applied function is monomorphic.
Instances
MonoMatch a a Source # | |
Defined in Data.Generics.ClassyPlate.Common | |
type AppSelector (MonoMatch a) b Source # | |
Defined in Data.Generics.ClassyPlate.Common |
descend :: forall c b. ClassyPlate c b => (forall a. (ClassyPlate c a, c a) => a -> a) -> b -> b Source #
Go down one level in the data structure and apply the given polymorphic function
descendM :: forall c b m. (ClassyPlate c b, Monad m) => (forall a. (ClassyPlate c a, c a) => a -> m a) -> b -> m b Source #
topDown :: forall c b. ClassyPlate c b => (forall a. (ClassyPlate c a, c a) => a -> a) -> b -> b Source #
Traverse the data structure in a top-down fashion with a polymorphic function.
topDownM :: forall c b m. (ClassyPlate c b, Monad m) => (forall a. (ClassyPlate c a, c a) => a -> m a) -> b -> m b Source #
bottomUp :: forall c b. ClassyPlate c b => (forall a. (ClassyPlate c a, c a) => a -> a) -> b -> b Source #
Traverse the data structure with a polymorphic function.
bottomUpM :: forall c b m. (ClassyPlate c b, Monad m) => (forall a. (ClassyPlate c a, c a) => a -> m a) -> b -> m b Source #
Traverse the data structure with a polymorphic monadic function.
selectiveTraverse :: forall c b. ClassyPlate c b => (forall a. (ClassyPlate c a, c a) => a -> (a, Bool)) -> b -> b Source #
Traverse the data structure selectively with a function specifying if need to go down on the subtrees.
selectiveTraverseM :: forall c b m. (Monad m, ClassyPlate c b) => (forall a. (ClassyPlate c a, c a) => a -> m (a, Bool)) -> b -> m b Source #
Traverse the data structure selectively with a monadic function specifying if need to go down on the subtrees.
smartTraverse :: forall c b. SmartClassyPlate c (ClassIgnoresSubtree c b) b => (forall a. (ClassyPlate c a, c a) => a -> a) -> b -> b Source #
Traverse only those parts of the data structure that could possibly contain elements that the given function can be applied on
smartTraverseM :: forall c b m. (SmartClassyPlate c (ClassIgnoresSubtree c b) b, Monad m) => (forall a. (ClassyPlate c a, c a) => a -> m a) -> b -> m b Source #
Traverse only those parts of the data structure that could possibly contain elements that the given monadic function can be applied on