deep-transformations-0.1: Deep natural and unnatural tree transformations, including attribute grammars
Safe HaskellNone
LanguageHaskell2010

Transformation.Full

Synopsis

Documentation

class (Transformation t, Functor (g (Domain t))) => Functor t g where Source #

Like Functor except it maps an additional wrapper around the entire tree

Methods

(<$>) :: t -> Domain t (g (Domain t) (Domain t)) -> Codomain t (g (Codomain t) (Codomain t)) Source #

Instances

Instances details
(Functor (Map p q) g, Functor p) => Functor (Map p q) g Source # 
Instance details

Defined in Transformation.Rank2

Methods

(<$>) :: Map p q -> Domain (Map p q) (g (Domain (Map p q)) (Domain (Map p q))) -> Codomain (Map p q) (g (Codomain (Map p q)) (Codomain (Map p q))) Source #

class (Transformation t, Foldable (g (Domain t))) => Foldable t g where Source #

Like Foldable except the entire tree is also wrapped

Methods

foldMap :: (Codomain t ~ Const m, Monoid m) => t -> Domain t (g (Domain t) (Domain t)) -> m Source #

class (Transformation t, Traversable (g (Domain t))) => Traversable t g where Source #

Like Traversable except it traverses an additional wrapper around the entire tree

Methods

traverse :: Codomain t ~ Compose m f => t -> Domain t (g (Domain t) (Domain t)) -> m (f (g f f)) Source #

fmap :: Functor t g => t -> Domain t (g (Domain t) (Domain t)) -> Codomain t (g (Codomain t) (Codomain t)) Source #

Alphabetical synonym for <$>

mapDownDefault :: (Functor t g, t `At` g (Domain t) (Domain t), Functor (Codomain t)) => t -> Domain t (g (Domain t) (Domain t)) -> Codomain t (g (Codomain t) (Codomain t)) Source #

Default implementation for <$> that maps the wrapper and then the tree

mapUpDefault :: (Functor t g, t `At` g (Codomain t) (Codomain t), Functor (Domain t)) => t -> Domain t (g (Domain t) (Domain t)) -> Codomain t (g (Codomain t) (Codomain t)) Source #

Default implementation for <$> that maps the tree and then the wrapper

foldMapDownDefault :: (t `At` g (Domain t) (Domain t), Foldable t g, Codomain t ~ Const m, Foldable (Domain t), Monoid m) => t -> Domain t (g (Domain t) (Domain t)) -> m Source #

Default implementation for foldMap that folds the wrapper and then the tree

foldMapUpDefault :: (t `At` g (Domain t) (Domain t), Foldable t g, Codomain t ~ Const m, Foldable (Domain t), Monoid m) => t -> Domain t (g (Domain t) (Domain t)) -> m Source #

Default implementation for foldMap that folds the tree and then the wrapper

traverseDownDefault :: (Traversable t g, t `At` g (Domain t) (Domain t), Codomain t ~ Compose m f, Traversable f, Monad m) => t -> Domain t (g (Domain t) (Domain t)) -> m (f (g f f)) Source #

Default implementation for traverse that traverses the wrapper and then the tree

traverseUpDefault :: (Traversable t g, Codomain t ~ Compose m f, t `At` g f f, Traversable (Domain t), Monad m) => t -> Domain t (g (Domain t) (Domain t)) -> m (f (g f f)) Source #

Default implementation for traverse that traverses the tree and then the wrapper