uniplate-1.6.8: Help writing simple, concise and fast generic operations.

Safe HaskellNone

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

composOp == descend

composOpM :: (Uniplate a, Monad m) => (a -> m a) -> a -> m aSource

composOpM == descendM

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

Probably replace with universe, perhaps para