| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Transformation.Full
Description
Type classes Functor, Foldable, and Traversable that correspond to the standard type classes of the same
name, but applying the given transformation to the given tree node and all its descendants. The corresponding classes
in the Transformation.Shallow moduleo perate only on the immediate children, while those from the
Transformation.Deep module exclude the argument node itself.
Synopsis
- class (Transformation t, Functor (g (Domain t))) => Functor t g where
- class (Transformation t, Foldable (g (Domain t))) => Foldable t g where
- class (Transformation t, Traversable (g (Domain t))) => Traversable t g where
- fmap :: Functor t g => t -> Domain t (g (Domain t) (Domain t)) -> Codomain t (g (Codomain t) (Codomain t))
- 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))
- 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))
- 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
- 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
- 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))
- 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))
Documentation
class (Transformation t, Functor (g (Domain t))) => Functor t g where Source #
Like Transformation.Deep.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)) infixl 4 Source #
Instances
| (Transformation (Keep t), Domain (Keep t) ~ f, Functor f, Codomain (Keep t) ~ PreservingSemantics f a, Functor f, Functor (Keep t) g, At (Keep t) (g (PreservingSemantics f a) (PreservingSemantics f a))) => Functor (Keep t) g Source # | |
| (Transformation (Auto t), Domain (Auto t) ~ f, Functor f, Codomain (Auto t) ~ Semantics (Auto t), Functor (Auto t) g, At (Auto t) (g (Semantics (Auto t)) (Semantics (Auto t)))) => Functor (Auto t) g Source # | |
| (Transformation (Keep t), Domain (Keep t) ~ f, Functor f, Codomain (Keep t) ~ PreservingSemantics (Keep t) f, Functor f, Functor (Keep t) g, At (Keep t) (g (PreservingSemantics (Keep t) f) (PreservingSemantics (Keep t) f))) => Functor (Keep t) g Source # | |
| (Transformation (Auto t), Domain (Auto t) ~ f, Functor f, Codomain (Auto t) ~ Semantics (Auto t), Functor (Auto t) g, At (Auto t) (g (Semantics (Auto t)) (Semantics (Auto t)))) => Functor (Auto t) g Source # | |
| (Functor (Map p q) g, Functor p) => Functor (Map p q) g Source # | |
class (Transformation t, Foldable (g (Domain t))) => Foldable t g where Source #
Like Transformation.Deep.Foldable except the entire tree is also wrapped
class (Transformation t, Traversable (g (Domain t))) => Traversable t g where Source #
Like Transformation.Deep.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 #
Instances
| (Transformation (Keep t), Domain (Keep t) ~ f, Traversable f, Traversable (g f), Codomain (Keep t) ~ PreservingSemantics f a, Traversable (Feeder a f) g, Functor (Keep t) g, At (Keep t) (g (PreservingSemantics f a) (PreservingSemantics f a))) => Traversable (Keep t) g Source # | |
| (Traversable f, Traversable (Feeder a f) g) => Traversable (Feeder a f) g 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