generic-deriving-1.14.6: Generic programming library for generalised deriving.

Safe Haskell | Safe
Language | Haskell2010

Generics.Deriving.Traversable

Contents

- Generic Traversable class
- Default method
- Internal Traversable class

Synopsis

- class (GFunctor t, GFoldable t) => GTraversable (t :: Type -> Type) where
  - gtraverse :: Applicative f => (a -> f b) -> t a -> f (t b)
  - gsequenceA :: Applicative f => t (f a) -> f (t a)
  - gmapM :: Monad m => (a -> m b) -> t a -> m (t b)
  - gsequence :: Monad m => t (m a) -> m (t a)
- gtraversedefault :: (Generic1 t, GTraversable' (Rep1 t), Applicative f) => (a -> f b) -> t a -> f (t b)
- class GTraversable' (t :: Type -> Type) where
  - gtraverse' :: Applicative f => (a -> f b) -> t a -> f (t b)

# Generic Traversable class

class (GFunctor t, GFoldable t) => GTraversable (t :: Type -> Type) where #

Minimal complete definition

Nothing

Methods

gtraverse :: Applicative f => (a -> f b) -> t a -> f (t b) #

default gtraverse :: (Generic1 t, GTraversable' (Rep1 t), Applicative f) => (a -> f b) -> t a -> f (t b) #

gsequenceA :: Applicative f => t (f a) -> f (t a) #

gmapM :: Monad m => (a -> m b) -> t a -> m (t b) #

gsequence :: Monad m => t (m a) -> m (t a) #

#### Instances

Instances details

GTraversable Complex # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse :: Applicative f => (a -> f b) -> Complex a -> f (Complex b) # gsequenceA :: Applicative f => Complex (f a) -> f (Complex a) # gmapM :: Monad m => (a -> m b) -> Complex a -> m (Complex b) # gsequence :: Monad m => Complex (m a) -> m (Complex a) #
GTraversable First # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse :: Applicative f => (a -> f b) -> First a -> f (First b) # gsequenceA :: Applicative f => First (f a) -> f (First a) # gmapM :: Monad m => (a -> m b) -> First a -> m (First b) # gsequence :: Monad m => First (m a) -> m (First a) #
GTraversable Last # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse :: Applicative f => (a -> f b) -> Last a -> f (Last b) # gsequenceA :: Applicative f => Last (f a) -> f (Last a) # gmapM :: Monad m => (a -> m b) -> Last a -> m (Last b) # gsequence :: Monad m => Last (m a) -> m (Last a) #
GTraversable Max # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse :: Applicative f => (a -> f b) -> Max a -> f (Max b) # gsequenceA :: Applicative f => Max (f a) -> f (Max a) # gmapM :: Monad m => (a -> m b) -> Max a -> m (Max b) # gsequence :: Monad m => Max (m a) -> m (Max a) #
GTraversable Min # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse :: Applicative f => (a -> f b) -> Min a -> f (Min b) # gsequenceA :: Applicative f => Min (f a) -> f (Min a) # gmapM :: Monad m => (a -> m b) -> Min a -> m (Min b) # gsequence :: Monad m => Min (m a) -> m (Min a) #
GTraversable WrappedMonoid # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse :: Applicative f => (a -> f b) -> WrappedMonoid a -> f (WrappedMonoid b) # gsequenceA :: Applicative f => WrappedMonoid (f a) -> f (WrappedMonoid a) # gmapM :: Monad m => (a -> m b) -> WrappedMonoid a -> m (WrappedMonoid b) # gsequence :: Monad m => WrappedMonoid (m a) -> m (WrappedMonoid a) #
GTraversable NonEmpty # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse :: Applicative f => (a -> f b) -> NonEmpty a -> f (NonEmpty b) # gsequenceA :: Applicative f => NonEmpty (f a) -> f (NonEmpty a) # gmapM :: Monad m => (a -> m b) -> NonEmpty a -> m (NonEmpty b) # gsequence :: Monad m => NonEmpty (m a) -> m (NonEmpty a) #
GTraversable Identity # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse :: Applicative f => (a -> f b) -> Identity a -> f (Identity b) # gsequenceA :: Applicative f => Identity (f a) -> f (Identity a) # gmapM :: Monad m => (a -> m b) -> Identity a -> m (Identity b) # gsequence :: Monad m => Identity (m a) -> m (Identity a) #
GTraversable First # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse :: Applicative f => (a -> f b) -> First a -> f (First b) # gsequenceA :: Applicative f => First (f a) -> f (First a) # gmapM :: Monad m => (a -> m b) -> First a -> m (First b) # gsequence :: Monad m => First (m a) -> m (First a) #
GTraversable Last # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse :: Applicative f => (a -> f b) -> Last a -> f (Last b) # gsequenceA :: Applicative f => Last (f a) -> f (Last a) # gmapM :: Monad m => (a -> m b) -> Last a -> m (Last b) # gsequence :: Monad m => Last (m a) -> m (Last a) #
GTraversable Down # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse :: Applicative f => (a -> f b) -> Down a -> f (Down b) # gsequenceA :: Applicative f => Down (f a) -> f (Down a) # gmapM :: Monad m => (a -> m b) -> Down a -> m (Down b) # gsequence :: Monad m => Down (m a) -> m (Down a) #
GTraversable Dual # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse :: Applicative f => (a -> f b) -> Dual a -> f (Dual b) # gsequenceA :: Applicative f => Dual (f a) -> f (Dual a) # gmapM :: Monad m => (a -> m b) -> Dual a -> m (Dual b) # gsequence :: Monad m => Dual (m a) -> m (Dual a) #
GTraversable Product # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse :: Applicative f => (a -> f b) -> Product a -> f (Product b) # gsequenceA :: Applicative f => Product (f a) -> f (Product a) # gmapM :: Monad m => (a -> m b) -> Product a -> m (Product b) # gsequence :: Monad m => Product (m a) -> m (Product a) #
GTraversable Sum # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse :: Applicative f => (a -> f b) -> Sum a -> f (Sum b) # gsequenceA :: Applicative f => Sum (f a) -> f (Sum a) # gmapM :: Monad m => (a -> m b) -> Sum a -> m (Sum b) # gsequence :: Monad m => Sum (m a) -> m (Sum a) #
GTraversable ZipList # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse :: Applicative f => (a -> f b) -> ZipList a -> f (ZipList b) # gsequenceA :: Applicative f => ZipList (f a) -> f (ZipList a) # gmapM :: Monad m => (a -> m b) -> ZipList a -> m (ZipList b) # gsequence :: Monad m => ZipList (m a) -> m (ZipList a) #
GTraversable Maybe # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse :: Applicative f => (a -> f b) -> Maybe a -> f (Maybe b) # gsequenceA :: Applicative f => Maybe (f a) -> f (Maybe a) # gmapM :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b) # gsequence :: Monad m => Maybe (m a) -> m (Maybe a) #
GTraversable [] # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse :: Applicative f => (a -> f b) -> [a] -> f [b] # gsequenceA :: Applicative f => [f a] -> f [a] # gmapM :: Monad m => (a -> m b) -> [a] -> m [b] # gsequence :: Monad m => [m a] -> m [a] #
GTraversable (Arg a) # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse :: Applicative f => (a0 -> f b) -> Arg a a0 -> f (Arg a b) # gsequenceA :: Applicative f => Arg a (f a0) -> f (Arg a a0) # gmapM :: Monad m => (a0 -> m b) -> Arg a a0 -> m (Arg a b) # gsequence :: Monad m => Arg a (m a0) -> m (Arg a a0) #
(Generic1 t, GFunctor' (Rep1 t), GFoldable' (Rep1 t), GTraversable' (Rep1 t)) => GTraversable (Default1 t) # |
Instance details Defined in Generics.Deriving.Default Methods gtraverse :: Applicative f => (a -> f b) -> Default1 t a -> f (Default1 t b) # gsequenceA :: Applicative f => Default1 t (f a) -> f (Default1 t a) # gmapM :: Monad m => (a -> m b) -> Default1 t a -> m (Default1 t b) # gsequence :: Monad m => Default1 t (m a) -> m (Default1 t a) #
GTraversable (Either a) # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse :: Applicative f => (a0 -> f b) -> Either a a0 -> f (Either a b) # gsequenceA :: Applicative f => Either a (f a0) -> f (Either a a0) # gmapM :: Monad m => (a0 -> m b) -> Either a a0 -> m (Either a b) # gsequence :: Monad m => Either a (m a0) -> m (Either a a0) #
GTraversable (Proxy :: Type -> Type) # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse :: Applicative f => (a -> f b) -> Proxy a -> f (Proxy b) # gsequenceA :: Applicative f => Proxy (f a) -> f (Proxy a) # gmapM :: Monad m => (a -> m b) -> Proxy a -> m (Proxy b) # gsequence :: Monad m => Proxy (m a) -> m (Proxy a) #
GTraversable ((,) a) # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse :: Applicative f => (a0 -> f b) -> (a, a0) -> f (a, b) # gsequenceA :: Applicative f => (a, f a0) -> f (a, a0) # gmapM :: Monad m => (a0 -> m b) -> (a, a0) -> m (a, b) # gsequence :: Monad m => (a, m a0) -> m (a, a0) #
GTraversable (Const m :: Type -> Type) # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse :: Applicative f => (a -> f b) -> Const m a -> f (Const m b) # gsequenceA :: Applicative f => Const m (f a) -> f (Const m a) # gmapM :: Monad m0 => (a -> m0 b) -> Const m a -> m0 (Const m b) # gsequence :: Monad m0 => Const m (m0 a) -> m0 (Const m a) #
(GTraversable f, GTraversable g) => GTraversable (Product f g) # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse :: Applicative f0 => (a -> f0 b) -> Product f g a -> f0 (Product f g b) # gsequenceA :: Applicative f0 => Product f g (f0 a) -> f0 (Product f g a) # gmapM :: Monad m => (a -> m b) -> Product f g a -> m (Product f g b) # gsequence :: Monad m => Product f g (m a) -> m (Product f g a) #
(GTraversable f, GTraversable g) => GTraversable (Sum f g) # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse :: Applicative f0 => (a -> f0 b) -> Sum f g a -> f0 (Sum f g b) # gsequenceA :: Applicative f0 => Sum f g (f0 a) -> f0 (Sum f g a) # gmapM :: Monad m => (a -> m b) -> Sum f g a -> m (Sum f g b) # gsequence :: Monad m => Sum f g (m a) -> m (Sum f g a) #

# Default method

gtraversedefault :: (Generic1 t, GTraversable' (Rep1 t), Applicative f) => (a -> f b) -> t a -> f (t b) #

# Internal Traversable class

class GTraversable' (t :: Type -> Type) where #

Methods

gtraverse' :: Applicative f => (a -> f b) -> t a -> f (t b) #

#### Instances

Instances details

GTraversable' Par1 # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse' :: Applicative f => (a -> f b) -> Par1 a -> f (Par1 b) #
GTraversable' (U1 :: Type -> Type) # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse' :: Applicative f => (a -> f b) -> U1 a -> f (U1 b) #
GTraversable' (UAddr :: Type -> Type) # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse' :: Applicative f => (a -> f b) -> UAddr a -> f (UAddr b) #
GTraversable' (UChar :: Type -> Type) # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse' :: Applicative f => (a -> f b) -> UChar a -> f (UChar b) #
GTraversable' (UDouble :: Type -> Type) # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse' :: Applicative f => (a -> f b) -> UDouble a -> f (UDouble b) #
GTraversable' (UFloat :: Type -> Type) # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse' :: Applicative f => (a -> f b) -> UFloat a -> f (UFloat b) #
GTraversable' (UInt :: Type -> Type) # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse' :: Applicative f => (a -> f b) -> UInt a -> f (UInt b) #
GTraversable' (UWord :: Type -> Type) # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse' :: Applicative f => (a -> f b) -> UWord a -> f (UWord b) #
GTraversable' (V1 :: Type -> Type) # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse' :: Applicative f => (a -> f b) -> V1 a -> f (V1 b) #
GTraversable f => GTraversable' (Rec1 f) # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse' :: Applicative f0 => (a -> f0 b) -> Rec1 f a -> f0 (Rec1 f b) #
(GTraversable' f, GTraversable' g) => GTraversable' (f :*: g) # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse' :: Applicative f0 => (a -> f0 b) -> (f :*: g) a -> f0 ((f :*: g) b) #
(GTraversable' f, GTraversable' g) => GTraversable' (f :+: g) # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse' :: Applicative f0 => (a -> f0 b) -> (f :+: g) a -> f0 ((f :+: g) b) #
GTraversable' (K1 i c :: Type -> Type) # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse' :: Applicative f => (a -> f b) -> K1 i c a -> f (K1 i c b) #
(GTraversable f, GTraversable' g) => GTraversable' (f :.: g) # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse' :: Applicative f0 => (a -> f0 b) -> (f :.: g) a -> f0 ((f :.: g) b) #
GTraversable' f => GTraversable' (M1 i c f) # |
Instance details Defined in Generics.Deriving.Traversable Methods gtraverse' :: Applicative f0 => (a -> f0 b) -> M1 i c f a -> f0 (M1 i c f b) #