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

Transformation.Shallow

Description

Type classes Functor, Foldable, and Traversable that correspond to the standard type classes of the same name. The rank2classes package provides the equivalent set of classes for natural transformations. This module extends the functionality to unnatural transformations.

Synopsis

Documentation

class (Transformation t, Functor g) => Functor t (g :: (Type -> Type) -> Type) where Source #

Like Rank2.Functor except it takes a Transformation instead of a polymorphic function

Methods

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

Instances

Instances details
Transformation t => Functor t (Proxy :: (Type -> Type) -> Type) Source # 
Instance details

Defined in Transformation.Shallow

Methods

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

Transformation t => Functor t (Empty :: (Type -> Type) -> Type) Source # 
Instance details

Defined in Transformation.Shallow

Methods

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

Transformation t => Functor t (Const a :: (Type -> Type) -> Type) Source # 
Instance details

Defined in Transformation.Shallow

Methods

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

Functor t g => Functor t (Identity g) Source # 
Instance details

Defined in Transformation.Shallow

Methods

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

(Transformation t, At t a) => Functor t (Only a) Source # 
Instance details

Defined in Transformation.Shallow

Methods

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

(Functor t g, Functor t h) => Functor t (Product g h) Source # 
Instance details

Defined in Transformation.Shallow

Methods

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

(Functor t g, Functor t h) => Functor t (Sum g h) Source # 
Instance details

Defined in Transformation.Shallow

Methods

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

(Transformation t, Functor (FunctorCompose p t) g, Functor p) => Functor t (Compose g p) Source # 
Instance details

Defined in Transformation.Shallow

Methods

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

(Transformation t, At t a, Functor g) => Functor t (Flip g a) Source # 
Instance details

Defined in Transformation.Shallow

Methods

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

class (Transformation t, Foldable g) => Foldable t (g :: (Type -> Type) -> Type) where Source #

Like Rank2.Foldable except it takes a Transformation instead of a polymorphic function

Methods

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

Instances

Instances details
Transformation t => Foldable t (Proxy :: (Type -> Type) -> Type) Source # 
Instance details

Defined in Transformation.Shallow

Methods

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

Transformation t => Foldable t (Empty :: (Type -> Type) -> Type) Source # 
Instance details

Defined in Transformation.Shallow

Methods

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

Transformation t => Foldable t (Const x :: (Type -> Type) -> Type) Source # 
Instance details

Defined in Transformation.Shallow

Methods

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

Foldable t g => Foldable t (Identity g) Source # 
Instance details

Defined in Transformation.Shallow

Methods

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

(Transformation t, At t a, Codomain t ~ (Const m :: Type -> Type)) => Foldable t (Only a) Source # 
Instance details

Defined in Transformation.Shallow

Methods

foldMap :: (Codomain t ~ (Const m0 :: Type -> Type), Monoid m0) => t -> Only a (Domain t) -> m0 Source #

(Foldable t g, Foldable t h, Codomain t ~ (Const m :: Type -> Type), Monoid m) => Foldable t (Product g h) Source # 
Instance details

Defined in Transformation.Shallow

Methods

foldMap :: (Codomain t ~ (Const m0 :: Type -> Type), Monoid m0) => t -> Product g h (Domain t) -> m0 Source #

(Foldable t g, Foldable t h) => Foldable t (Sum g h) Source # 
Instance details

Defined in Transformation.Shallow

Methods

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

(Transformation t, Foldable (FoldableCompose p t) g, Foldable p) => Foldable t (Compose g p) Source # 
Instance details

Defined in Transformation.Shallow

Methods

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

(Transformation t, At t a, Codomain t ~ (Const m :: Type -> Type), Foldable g) => Foldable t (Flip g a) Source # 
Instance details

Defined in Transformation.Shallow

Methods

foldMap :: (Codomain t ~ (Const m0 :: Type -> Type), Monoid m0) => t -> Flip g a (Domain t) -> m0 Source #

class (Transformation t, Traversable g) => Traversable t (g :: (Type -> Type) -> Type) where Source #

Like Rank2.Traversable except it takes a Transformation instead of a polymorphic function

Methods

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

Instances

Instances details
(Transformation t, Codomain t ~ Compose m f, Applicative m) => Traversable t (Proxy :: (Type -> Type) -> Type) Source # 
Instance details

Defined in Transformation.Shallow

Methods

traverse :: forall m0 (f0 :: Type -> Type). Codomain t ~ Compose m0 f0 => t -> Proxy (Domain t) -> m0 (Proxy f0) Source #

(Transformation t, Codomain t ~ Compose m f, Applicative m) => Traversable t (Empty :: (Type -> Type) -> Type) Source # 
Instance details

Defined in Transformation.Shallow

Methods

traverse :: forall m0 (f0 :: Type -> Type). Codomain t ~ Compose m0 f0 => t -> Empty (Domain t) -> m0 (Empty f0) Source #

(Transformation t, Codomain t ~ Compose m f, Applicative m) => Traversable t (Const x :: (Type -> Type) -> Type) Source # 
Instance details

Defined in Transformation.Shallow

Methods

traverse :: forall m0 (f0 :: Type -> Type). Codomain t ~ Compose m0 f0 => t -> Const x (Domain t) -> m0 (Const x f0) Source #

(Traversable t g, Codomain t ~ Compose m f, Functor m) => Traversable t (Identity g) Source # 
Instance details

Defined in Transformation.Shallow

Methods

traverse :: forall m0 (f0 :: Type -> Type). Codomain t ~ Compose m0 f0 => t -> Identity g (Domain t) -> m0 (Identity g f0) Source #

(Transformation t, At t a, Codomain t ~ Compose m f, Functor m) => Traversable t (Only a) Source # 
Instance details

Defined in Transformation.Shallow

Methods

traverse :: forall m0 (f0 :: Type -> Type). Codomain t ~ Compose m0 f0 => t -> Only a (Domain t) -> m0 (Only a f0) Source #

(Traversable t g, Traversable t h, Codomain t ~ Compose m f, Applicative m) => Traversable t (Product g h) Source # 
Instance details

Defined in Transformation.Shallow

Methods

traverse :: forall m0 (f0 :: Type -> Type). Codomain t ~ Compose m0 f0 => t -> Product g h (Domain t) -> m0 (Product g h f0) Source #

(Traversable t g, Traversable t h, Codomain t ~ Compose m f, Functor m) => Traversable t (Sum g h) Source # 
Instance details

Defined in Transformation.Shallow

Methods

traverse :: forall m0 (f0 :: Type -> Type). Codomain t ~ Compose m0 f0 => t -> Sum g h (Domain t) -> m0 (Sum g h f0) Source #

(Transformation t, Traversable (TraversableCompose p t) g, Traversable p, Codomain t ~ Compose q r, Functor q) => Traversable t (Compose g p) Source # 
Instance details

Defined in Transformation.Shallow

Methods

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

(Transformation t, At t a, Codomain t ~ Compose m f, Applicative m, Traversable g) => Traversable t (Flip g a) Source # 
Instance details

Defined in Transformation.Shallow

Methods

traverse :: forall m0 (f0 :: Type -> Type). Codomain t ~ Compose m0 f0 => t -> Flip g a (Domain t) -> m0 (Flip g a f0) Source #

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

Alphabetical synonym for <$>