uniplate-1.6.13: Help writing simple, concise and fast generic operations.
Safe HaskellNone
LanguageHaskell2010

Data.Generics.Compos

Description

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

Documentation

class Uniplate a => Compos a Source #

If you want to keep an existing type class

composOp :: Uniplate a => (a -> a) -> a -> a Source #

composOp == descend

composOpM :: (Uniplate a, Applicative m) => (a -> m a) -> a -> m a Source #

composOpM == descendM

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

composOpFold :: Uniplate a => b -> (b -> b -> b) -> (a -> b) -> a -> b Source #

Probably replace with universe, perhaps para