Haskell Hierarchical Libraries (base package)ContentsIndex
Data.Generics.Twins
Portability non-portable
Stability experimental
Maintainer libraries@haskell.org
Contents
The idiom of multi-parameter traversal
Twin mapping combinators
Prime examples of twin traversal
Description
"Scrap your boilerplate" --- Generic programming in Haskell See http://www.cs.vu.nl/boilerplate/. The present module provides support for multi-parameter traversal, which is also demonstrated with generic operations like equality.
Synopsis
tfoldl :: (forall a b . Data a => c (a -> b) -> c a -> c b) -> (forall g . g -> c g) -> GenericQ (Generic c) -> GenericQ (Generic c)
tmapT :: GenericQ GenericT -> GenericQ GenericT
tmapQl :: (r -> r -> r) -> r -> GenericQ (GenericQ r) -> GenericQ (GenericQ r)
tmapM :: Monad m => GenericQ (GenericM m) -> GenericQ (GenericM m)
geq :: Data a => a -> a -> Bool
gzip :: (forall a b . (Data a, Data b) => a -> b -> Maybe b) -> forall a b . (Data a, Data b) => a -> b -> Maybe b
The idiom of multi-parameter traversal
tfoldl :: (forall a b . Data a => c (a -> b) -> c a -> c b) -> (forall g . g -> c g) -> GenericQ (Generic c) -> GenericQ (Generic c)
Twin mapping combinators
tmapT :: GenericQ GenericT -> GenericQ GenericT
tmapQl :: (r -> r -> r) -> r -> GenericQ (GenericQ r) -> GenericQ (GenericQ r)
tmapM :: Monad m => GenericQ (GenericM m) -> GenericQ (GenericM m)
Prime examples of twin traversal
geq :: Data a => a -> a -> Bool
Generic equality: an alternative to "deriving Eq"
gzip :: (forall a b . (Data a, Data b) => a -> b -> Maybe b) -> forall a b . (Data a, Data b) => a -> b -> Maybe b
Generic zip controlled by a function with type-specific branches
Produced by Haddock version 0.6