Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Type classes Functor
, Foldable
, and Traversable
that correspond to the standard type classes of the same
name, but applying the given transformation to every descendant of the given tree node. The corresponding classes
in the Transformation.Shallow module operate only on the immediate children, while those from the
Transformation.Full module include 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
- newtype Only g (d :: Type -> Type) (s :: Type -> Type) = Only {
- fromOnly :: s (g d d)
- newtype Nest (f :: Type -> Type) g (d :: Type -> Type) (s :: Type -> Type) = Nest {
- unNest :: f (g d s)
- data Product g h (d :: Type -> Type) (s :: Type -> Type) = Pair {}
- data Sum g h (d :: Type -> Type) (s :: Type -> Type)
- fmap :: Functor t g => t -> g (Domain t) (Domain t) -> g (Codomain t) (Codomain t)
- eitherFromSum :: Sum g h d s -> Either (g d s) (h d s)
Documentation
class (Transformation t, Functor (g (Domain t))) => Functor t g where Source #
Like Transformation.Shallow.Functor
except it maps all descendants and not only immediate children
class (Transformation t, Foldable (g (Domain t))) => Foldable t g where Source #
Like Transformation.Shallow.Foldable
except it folds all descendants and not only immediate children
class (Transformation t, Traversable (g (Domain t))) => Traversable t g where Source #
Like Transformation.Shallow.Traversable
except it folds all descendants and not only immediate children
Instances
(Traversable t g, Codomain t ~ Compose m f, Functor m) => Traversable t (Only g) Source # | |
(Traversable f, Traversable t g, Codomain t ~ Compose m f, Applicative m) => Traversable t (Nest f g) Source # | |
(Traversable t g, Traversable t h, Codomain t ~ Compose m f, Applicative m) => Traversable t (Product g h) Source # | |
(Traversable t g, Traversable t h, Codomain t ~ Compose m f, Applicative m) => Traversable t (Sum g h) Source # | |
newtype Only g (d :: Type -> Type) (s :: Type -> Type) Source #
A tuple of only one element
Instances
Foldable t g => Foldable t (Only g) Source # | |
Functor t g => Functor t (Only g) Source # | |
(Traversable t g, Codomain t ~ Compose m f, Functor m) => Traversable t (Only g) Source # | |
Applicative (Only g d :: (Type -> Type) -> Type) Source # | |
Defined in Transformation.Deep | |
Apply (Only g d :: (Type -> Type) -> Type) Source # | |
Defined in Transformation.Deep | |
Distributive (Only g d :: (Type -> Type) -> Type) Source # | |
Defined in Transformation.Deep | |
DistributiveTraversable (Only g d :: (Type -> Type) -> Type) Source # | |
Defined in Transformation.Deep collectTraversable :: forall f1 a (f2 :: k -> Type). Traversable f1 => (a -> Only g d f2) -> f1 a -> Only g d (Compose f1 f2) # distributeTraversable :: forall f1 (f2 :: k -> Type). Traversable f1 => f1 (Only g d f2) -> Only g d (Compose f1 f2) # cotraverseTraversable :: Traversable f1 => (forall (x :: k). f1 (f2 x) -> f x) -> f1 (Only g d f2) -> Only g d f # | |
Foldable (Only g d :: (Type -> Type) -> Type) Source # | |
Defined in Transformation.Deep | |
Functor (Only g d :: (Type -> Type) -> Type) Source # | |
Defined in Transformation.Deep | |
Traversable (Only g d :: (Type -> Type) -> Type) Source # | |
Defined in Transformation.Deep | |
(Typeable s, Typeable d, Typeable g, Data (s (g d d))) => Data (Only g d s) Source # | |
Defined in Transformation.Deep gfoldl :: (forall d0 b. Data d0 => c (d0 -> b) -> d0 -> c b) -> (forall g0. g0 -> c g0) -> Only g d s -> c (Only g d s) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Only g d s) # toConstr :: Only g d s -> Constr # dataTypeOf :: Only g d s -> DataType # dataCast1 :: Typeable t => (forall d0. Data d0 => c (t d0)) -> Maybe (c (Only g d s)) # dataCast2 :: Typeable t => (forall d0 e. (Data d0, Data e) => c (t d0 e)) -> Maybe (c (Only g d s)) # gmapT :: (forall b. Data b => b -> b) -> Only g d s -> Only g d s # gmapQl :: (r -> r' -> r) -> r -> (forall d0. Data d0 => d0 -> r') -> Only g d s -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d0. Data d0 => d0 -> r') -> Only g d s -> r # gmapQ :: (forall d0. Data d0 => d0 -> u) -> Only g d s -> [u] # gmapQi :: Int -> (forall d0. Data d0 => d0 -> u) -> Only g d s -> u # gmapM :: Monad m => (forall d0. Data d0 => d0 -> m d0) -> Only g d s -> m (Only g d s) # gmapMp :: MonadPlus m => (forall d0. Data d0 => d0 -> m d0) -> Only g d s -> m (Only g d s) # gmapMo :: MonadPlus m => (forall d0. Data d0 => d0 -> m d0) -> Only g d s -> m (Only g d s) # | |
Show (s (g d d)) => Show (Only g d s) Source # | |
Eq (s (g d d)) => Eq (Only g d s) Source # | |
Ord (s (g d d)) => Ord (Only g d s) Source # | |
newtype Nest (f :: Type -> Type) g (d :: Type -> Type) (s :: Type -> Type) Source #
Compose a regular type constructor with a data type with two type constructor parameters
Instances
(Foldable f, Foldable t g) => Foldable t (Nest f g) Source # | |
(Functor f, Functor t g) => Functor t (Nest f g) Source # | |
(Traversable f, Traversable t g, Codomain t ~ Compose m f, Applicative m) => Traversable t (Nest f g) Source # | |
(Applicative f, Applicative (g d)) => Applicative (Nest f g d :: (Type -> Type) -> Type) Source # | |
Defined in Transformation.Deep | |
(Applicative f, Apply (g d)) => Apply (Nest f g d :: (Type -> Type) -> Type) Source # | |
Defined in Transformation.Deep (<*>) :: forall (p :: k -> Type) (q :: k -> Type). Nest f g d (p ~> q) -> Nest f g d p -> Nest f g d q # liftA2 :: (forall (a :: k). p a -> q a -> r a) -> Nest f g d p -> Nest f g d q -> Nest f g d r # liftA3 :: (forall (a :: k). p a -> q a -> r a -> s a) -> Nest f g d p -> Nest f g d q -> Nest f g d r -> Nest f g d s # | |
(Foldable f, Foldable (g d)) => Foldable (Nest f g d :: (Type -> Type) -> Type) Source # | |
Defined in Transformation.Deep | |
(Functor f, Functor (g d)) => Functor (Nest f g d :: (Type -> Type) -> Type) Source # | |
Defined in Transformation.Deep | |
(Traversable f, Traversable (g d)) => Traversable (Nest f g d :: (Type -> Type) -> Type) Source # | |
Defined in Transformation.Deep | |
(Typeable s, Typeable d, Typeable f, Typeable g, Data (f (g d s))) => Data (Nest f g d s) Source # | |
Defined in Transformation.Deep gfoldl :: (forall d0 b. Data d0 => c (d0 -> b) -> d0 -> c b) -> (forall g0. g0 -> c g0) -> Nest f g d s -> c (Nest f g d s) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Nest f g d s) # toConstr :: Nest f g d s -> Constr # dataTypeOf :: Nest f g d s -> DataType # dataCast1 :: Typeable t => (forall d0. Data d0 => c (t d0)) -> Maybe (c (Nest f g d s)) # dataCast2 :: Typeable t => (forall d0 e. (Data d0, Data e) => c (t d0 e)) -> Maybe (c (Nest f g d s)) # gmapT :: (forall b. Data b => b -> b) -> Nest f g d s -> Nest f g d s # gmapQl :: (r -> r' -> r) -> r -> (forall d0. Data d0 => d0 -> r') -> Nest f g d s -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d0. Data d0 => d0 -> r') -> Nest f g d s -> r # gmapQ :: (forall d0. Data d0 => d0 -> u) -> Nest f g d s -> [u] # gmapQi :: Int -> (forall d0. Data d0 => d0 -> u) -> Nest f g d s -> u # gmapM :: Monad m => (forall d0. Data d0 => d0 -> m d0) -> Nest f g d s -> m (Nest f g d s) # gmapMp :: MonadPlus m => (forall d0. Data d0 => d0 -> m d0) -> Nest f g d s -> m (Nest f g d s) # gmapMo :: MonadPlus m => (forall d0. Data d0 => d0 -> m d0) -> Nest f g d s -> m (Nest f g d s) # | |
Show (f (g d s)) => Show (Nest f g d s) Source # | |
Eq (f (g d s)) => Eq (Nest f g d s) Source # | |
Ord (f (g d s)) => Ord (Nest f g d s) Source # | |
Defined in Transformation.Deep |
data Product g h (d :: Type -> Type) (s :: Type -> Type) Source #
Like Product
for data types with two type constructor parameters
Instances
(Foldable t g, Foldable t h) => Foldable t (Product g h) Source # | |
(Functor t g, Functor t h) => Functor t (Product g h) Source # | |
(Traversable t g, Traversable t h, Codomain t ~ Compose m f, Applicative m) => Traversable t (Product g h) Source # | |
(Applicative (g d), Applicative (h d)) => Applicative (Product g h d :: (Type -> Type) -> Type) Source # | |
Defined in Transformation.Deep | |
(Apply (g d), Apply (h d)) => Apply (Product g h d :: (Type -> Type) -> Type) Source # | |
Defined in Transformation.Deep (<*>) :: forall (p :: k -> Type) (q :: k -> Type). Product g h d (p ~> q) -> Product g h d p -> Product g h d q # liftA2 :: (forall (a :: k). p a -> q a -> r a) -> Product g h d p -> Product g h d q -> Product g h d r # liftA3 :: (forall (a :: k). p a -> q a -> r a -> s a) -> Product g h d p -> Product g h d q -> Product g h d r -> Product g h d s # | |
(Distributive (g d), Distributive (h d)) => Distributive (Product g h d :: (Type -> Type) -> Type) Source # | |
Defined in Transformation.Deep collect :: forall p a (q :: k1 -> Type). Functor p => (a -> Product g h d q) -> p a -> Product g h d (Compose p q) # distribute :: forall p (q :: k1 -> Type). Functor p => p (Product g h d q) -> Product g h d (Compose p q) # cotraverse :: Functor m => (forall (a :: k1). m (p a) -> q a) -> m (Product g h d p) -> Product g h d q # | |
(Distributive (g d), Distributive (h d)) => DistributiveTraversable (Product g h d :: (Type -> Type) -> Type) Source # | |
Defined in Transformation.Deep collectTraversable :: forall f1 a (f2 :: k -> Type). Traversable f1 => (a -> Product g h d f2) -> f1 a -> Product g h d (Compose f1 f2) # distributeTraversable :: forall f1 (f2 :: k -> Type). Traversable f1 => f1 (Product g h d f2) -> Product g h d (Compose f1 f2) # cotraverseTraversable :: Traversable f1 => (forall (x :: k). f1 (f2 x) -> f x) -> f1 (Product g h d f2) -> Product g h d f # | |
(Foldable (g d), Foldable (h d)) => Foldable (Product g h d :: (Type -> Type) -> Type) Source # | |
Defined in Transformation.Deep | |
(Functor (g d), Functor (h d)) => Functor (Product g h d :: (Type -> Type) -> Type) Source # | |
Defined in Transformation.Deep | |
(Traversable (g d), Traversable (h d)) => Traversable (Product g h d :: (Type -> Type) -> Type) Source # | |
Defined in Transformation.Deep | |
(Typeable d, Typeable s, Typeable g1, Typeable g2, Data (g1 d s), Data (g2 d s)) => Data (Product g1 g2 d s) Source # | |
Defined in Transformation.Deep gfoldl :: (forall d0 b. Data d0 => c (d0 -> b) -> d0 -> c b) -> (forall g. g -> c g) -> Product g1 g2 d s -> c (Product g1 g2 d s) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Product g1 g2 d s) # toConstr :: Product g1 g2 d s -> Constr # dataTypeOf :: Product g1 g2 d s -> DataType # dataCast1 :: Typeable t => (forall d0. Data d0 => c (t d0)) -> Maybe (c (Product g1 g2 d s)) # dataCast2 :: Typeable t => (forall d0 e. (Data d0, Data e) => c (t d0 e)) -> Maybe (c (Product g1 g2 d s)) # gmapT :: (forall b. Data b => b -> b) -> Product g1 g2 d s -> Product g1 g2 d s # gmapQl :: (r -> r' -> r) -> r -> (forall d0. Data d0 => d0 -> r') -> Product g1 g2 d s -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d0. Data d0 => d0 -> r') -> Product g1 g2 d s -> r # gmapQ :: (forall d0. Data d0 => d0 -> u) -> Product g1 g2 d s -> [u] # gmapQi :: Int -> (forall d0. Data d0 => d0 -> u) -> Product g1 g2 d s -> u # gmapM :: Monad m => (forall d0. Data d0 => d0 -> m d0) -> Product g1 g2 d s -> m (Product g1 g2 d s) # gmapMp :: MonadPlus m => (forall d0. Data d0 => d0 -> m d0) -> Product g1 g2 d s -> m (Product g1 g2 d s) # gmapMo :: MonadPlus m => (forall d0. Data d0 => d0 -> m d0) -> Product g1 g2 d s -> m (Product g1 g2 d s) # | |
(Show (g1 d s), Show (g2 d s)) => Show (Product g1 g2 d s) Source # | |
(Eq (g d s), Eq (h d s)) => Eq (Product g h d s) Source # | |
(Ord (g d s), Ord (h d s)) => Ord (Product g h d s) Source # | |
Defined in Transformation.Deep compare :: Product g h d s -> Product g h d s -> Ordering # (<) :: Product g h d s -> Product g h d s -> Bool # (<=) :: Product g h d s -> Product g h d s -> Bool # (>) :: Product g h d s -> Product g h d s -> Bool # (>=) :: Product g h d s -> Product g h d s -> Bool # max :: Product g h d s -> Product g h d s -> Product g h d s # min :: Product g h d s -> Product g h d s -> Product g h d s # |
data Sum g h (d :: Type -> Type) (s :: Type -> Type) Source #
Like Sum
for data types with two type constructor parameters
Instances
(Foldable t g, Foldable t h, Codomain t ~ (Const m :: Type -> Type)) => Foldable t (Sum g h) Source # | |
(Functor t g, Functor t h) => Functor t (Sum g h) Source # | |
(Traversable t g, Traversable t h, Codomain t ~ Compose m f, Applicative m) => Traversable t (Sum g h) Source # | |
(Foldable (g d), Foldable (h d)) => Foldable (Sum g h d :: (Type -> Type) -> Type) Source # | |
Defined in Transformation.Deep | |
(Functor (g d), Functor (h d)) => Functor (Sum g h d :: (Type -> Type) -> Type) Source # | |
Defined in Transformation.Deep | |
(Traversable (g d), Traversable (h d)) => Traversable (Sum g h d :: (Type -> Type) -> Type) Source # | |
Defined in Transformation.Deep | |
(Typeable d, Typeable s, Typeable g1, Typeable g2, Data (g1 d s), Data (g2 d s)) => Data (Sum g1 g2 d s) Source # | |
Defined in Transformation.Deep gfoldl :: (forall d0 b. Data d0 => c (d0 -> b) -> d0 -> c b) -> (forall g. g -> c g) -> Sum g1 g2 d s -> c (Sum g1 g2 d s) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Sum g1 g2 d s) # toConstr :: Sum g1 g2 d s -> Constr # dataTypeOf :: Sum g1 g2 d s -> DataType # dataCast1 :: Typeable t => (forall d0. Data d0 => c (t d0)) -> Maybe (c (Sum g1 g2 d s)) # dataCast2 :: Typeable t => (forall d0 e. (Data d0, Data e) => c (t d0 e)) -> Maybe (c (Sum g1 g2 d s)) # gmapT :: (forall b. Data b => b -> b) -> Sum g1 g2 d s -> Sum g1 g2 d s # gmapQl :: (r -> r' -> r) -> r -> (forall d0. Data d0 => d0 -> r') -> Sum g1 g2 d s -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d0. Data d0 => d0 -> r') -> Sum g1 g2 d s -> r # gmapQ :: (forall d0. Data d0 => d0 -> u) -> Sum g1 g2 d s -> [u] # gmapQi :: Int -> (forall d0. Data d0 => d0 -> u) -> Sum g1 g2 d s -> u # gmapM :: Monad m => (forall d0. Data d0 => d0 -> m d0) -> Sum g1 g2 d s -> m (Sum g1 g2 d s) # gmapMp :: MonadPlus m => (forall d0. Data d0 => d0 -> m d0) -> Sum g1 g2 d s -> m (Sum g1 g2 d s) # gmapMo :: MonadPlus m => (forall d0. Data d0 => d0 -> m d0) -> Sum g1 g2 d s -> m (Sum g1 g2 d s) # | |
(Show (g1 d s), Show (g2 d s)) => Show (Sum g1 g2 d s) Source # | |
(Eq (g d s), Eq (h d s)) => Eq (Sum g h d s) Source # | |
(Ord (g d s), Ord (h d s)) => Ord (Sum g h d s) Source # | |
Defined in Transformation.Deep |