Safe Haskell | None |
---|
Compos compatibility layer. This module serves as a drop-in replacement in some situations for some of the Compos operations. Only the single-type traversals are supported, on normal algebraic data types. Users should also import either Data.Generics.Uniplate.Data or Data.Generics.Uniplate.Direct.
Compos is described in the paper: "A Pattern for Almost Compositional Functions" by Bjorn Bringert and Aarne Ranta.
- class Uniplate a => Compos a
- composOp :: Uniplate a => (a -> a) -> a -> a
- composOpM :: (Uniplate a, Monad m) => (a -> m a) -> a -> m a
- composOpM_ :: (Uniplate a, Monad m) => (a -> m ()) -> a -> m ()
- composOpMonoid :: (Uniplate a, Monoid m) => (a -> m) -> a -> m
- composOpMPlus :: (Uniplate a, MonadPlus m) => (a -> m b) -> a -> m b
- composOpFold :: Uniplate a => b -> (b -> b -> b) -> (a -> b) -> a -> b
Documentation
composOpM_ :: (Uniplate a, Monad m) => (a -> m ()) -> a -> m ()Source
composOpM_ == composOpFold
(return ()) (>>)
composOpMonoid :: (Uniplate a, Monoid m) => (a -> m) -> a -> mSource
composOpMonoid = composOpFold
mempty mappend
composOpMPlus :: (Uniplate a, MonadPlus m) => (a -> m b) -> a -> m bSource
composOpMPlus = composOpFold
mzero mplus
composOpFold :: Uniplate a => b -> (b -> b -> b) -> (a -> b) -> a -> bSource