Safe Haskell | None |
---|---|
Language | Haskell2010 |
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.
Synopsis
- class Uniplate a => Compos a
- composOp :: Uniplate a => (a -> a) -> a -> a
- composOpM :: (Uniplate a, Applicative 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 -> m Source #
composOpMonoid = composOpFold
mempty mappend
composOpMPlus :: (Uniplate a, MonadPlus m) => (a -> m b) -> a -> m b Source #
composOpMPlus = composOpFold
mzero mplus