Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Data.Key
Synopsis
- type family Key (f :: Type -> Type)
- class Functor f => Keyed (f :: Type -> Type) where
- mapWithKey :: (Key f -> a -> b) -> f a -> f b
- (<#$>) :: Keyed f => (Key f -> a -> b) -> f a -> f b
- keyed :: Keyed f => f a -> f (Key f, a)
- class Functor f => Zip (f :: Type -> Type) where
- class (Keyed f, Zip f) => ZipWithKey (f :: Type -> Type) where
- zipWithKey :: (Key f -> a -> b -> c) -> f a -> f b -> f c
- zapWithKey :: f (Key f -> a -> b) -> f a -> f b
- class Lookup f => Indexable (f :: Type -> Type) where
- (!) :: Indexable f => f a -> Key f -> a
- class Lookup (f :: Type -> Type) where
- lookupDefault :: Indexable f => Key f -> f a -> Maybe a
- class Functor f => Adjustable (f :: Type -> Type) where
- class Foldable t => FoldableWithKey (t :: Type -> Type) where
- toKeyedList :: t a -> [(Key t, a)]
- foldMapWithKey :: Monoid m => (Key t -> a -> m) -> t a -> m
- foldrWithKey :: (Key t -> a -> b -> b) -> b -> t a -> b
- foldlWithKey :: (b -> Key t -> a -> b) -> b -> t a -> b
- foldrWithKey' :: FoldableWithKey t => (Key t -> a -> b -> b) -> b -> t a -> b
- foldlWithKey' :: FoldableWithKey t => (b -> Key t -> a -> b) -> b -> t a -> b
- foldrWithKeyM :: (FoldableWithKey t, Monad m) => (Key t -> a -> b -> m b) -> b -> t a -> m b
- foldlWithKeyM :: (FoldableWithKey t, Monad m) => (b -> Key t -> a -> m b) -> b -> t a -> m b
- traverseWithKey_ :: (FoldableWithKey t, Applicative f) => (Key t -> a -> f b) -> t a -> f ()
- forWithKey_ :: (FoldableWithKey t, Applicative f) => t a -> (Key t -> a -> f b) -> f ()
- mapWithKeyM_ :: (FoldableWithKey t, Monad m) => (Key t -> a -> m b) -> t a -> m ()
- forWithKeyM_ :: (FoldableWithKey t, Monad m) => t a -> (Key t -> a -> m b) -> m ()
- concatMapWithKey :: FoldableWithKey t => (Key t -> a -> [b]) -> t a -> [b]
- anyWithKey :: FoldableWithKey t => (Key t -> a -> Bool) -> t a -> Bool
- allWithKey :: FoldableWithKey t => (Key t -> a -> Bool) -> t a -> Bool
- findWithKey :: FoldableWithKey t => (Key t -> a -> Bool) -> t a -> Maybe a
- class (Foldable1 t, FoldableWithKey t) => FoldableWithKey1 (t :: Type -> Type) where
- foldMapWithKey1 :: Semigroup m => (Key t -> a -> m) -> t a -> m
- traverseWithKey1_ :: (FoldableWithKey1 t, Apply f) => (Key t -> a -> f b) -> t a -> f ()
- forWithKey1_ :: (FoldableWithKey1 t, Apply f) => t a -> (Key t -> a -> f b) -> f ()
- foldMapWithKeyDefault1 :: (FoldableWithKey1 t, Monoid m) => (Key t -> a -> m) -> t a -> m
- class (Keyed t, FoldableWithKey t, Traversable t) => TraversableWithKey (t :: Type -> Type) where
- traverseWithKey :: Applicative f => (Key t -> a -> f b) -> t a -> f (t b)
- mapWithKeyM :: Monad m => (Key t -> a -> m b) -> t a -> m (t b)
- forWithKey :: (TraversableWithKey t, Applicative f) => t a -> (Key t -> a -> f b) -> f (t b)
- forWithKeyM :: (TraversableWithKey t, Monad m) => t a -> (Key t -> a -> m b) -> m (t b)
- mapAccumWithKeyL :: TraversableWithKey t => (Key t -> a -> b -> (a, c)) -> a -> t b -> (a, t c)
- mapAccumWithKeyR :: TraversableWithKey t => (Key t -> a -> b -> (a, c)) -> a -> t b -> (a, t c)
- mapWithKeyDefault :: TraversableWithKey t => (Key t -> a -> b) -> t a -> t b
- foldMapWithKeyDefault :: (TraversableWithKey t, Monoid m) => (Key t -> a -> m) -> t a -> m
- class (Traversable1 t, FoldableWithKey1 t, TraversableWithKey t) => TraversableWithKey1 (t :: Type -> Type) where
- traverseWithKey1 :: Apply f => (Key t -> a -> f b) -> t a -> f (t b)
- foldMapWithKey1Default :: (TraversableWithKey1 t, Semigroup m) => (Key t -> a -> m) -> t a -> m
Keys
type family Key (f :: Type -> Type) #
Instances
type Key ZipList # | |
type Key Identity # | |
type Key NonEmpty # | |
type Key Par1 # | |
type Key IntMap # | |
type Key Seq # | |
type Key Tree # | |
type Key Maybe # | |
type Key [] # | |
type Key (Proxy :: Type -> Type) # | |
type Key (Array i) # | |
type Key (U1 :: Type -> Type) # | |
type Key (V1 :: Type -> Type) # | |
type Key (Map k) # | |
type Key (Cofree f) # | |
type Key (Free f) # | |
type Key (HashMap k) # | |
type Key ((,) k) # | |
type Key (Const e :: Type -> Type) # | |
type Key (Rec1 f) # | |
type Key (TracedT s w) # | |
type Key (Tagged a) # | |
type Key (IdentityT m) # | |
type Key (ReaderT e m) # | |
type Key (Constant e :: Type -> Type) # | |
type Key (Product f g) # | |
type Key (Sum f g) # | |
type Key (f :*: g) # | |
type Key (f :+: g) # | |
type Key (K1 i c :: Type -> Type) # | |
type Key ((->) a) # | |
type Key (Compose f g) # | |
type Key (g :.: f) # | |
type Key (M1 i c f) # | |
Keyed functors
class Functor f => Keyed (f :: Type -> Type) where #
Methods
mapWithKey :: (Key f -> a -> b) -> f a -> f b #
Instances
Zippable functors
class Functor f => Zip (f :: Type -> Type) where #
Laws:
fmap
fst
(zip
u u) = ufmap
snd
(zip
u u) = uzip
(fmap
fst
u) (fmap
snd
u) = uzip
(flip
(,)) x y =zip
y x
Instances
Zip ZipList # | |
Zip Identity # | |
Zip NonEmpty # | |
Zip Par1 # | |
Zip IntMap # | |
Zip Seq # | |
Zip Tree # | |
Zip Maybe # | |
Zip [] # | |
Zip (Proxy :: Type -> Type) # | |
Zip (U1 :: Type -> Type) # | |
Zip (V1 :: Type -> Type) # | |
Ord k => Zip (Map k) # | |
Zip f => Zip (Cofree f) # | |
(Eq k, Hashable k) => Zip (HashMap k) # | |
Zip f => Zip (Rec1 f) # | |
Zip w => Zip (TracedT s w) # | |
Zip (Tagged a) # | |
Zip m => Zip (IdentityT m) # | |
Zip m => Zip (ReaderT e m) # | |
(Zip f, Zip g) => Zip (Product f g) # | |
(Zip f, Zip g) => Zip (f :*: g) # | |
Zip ((->) a) # | |
(Zip f, Zip g) => Zip (Compose f g) # | |
(Zip f, Zip g) => Zip (g :.: f) # | |
Zip f => Zip (M1 i c f) # | |
Zipping keyed functors
class (Keyed f, Zip f) => ZipWithKey (f :: Type -> Type) where #
Minimal complete definition
Nothing
Methods
zipWithKey :: (Key f -> a -> b -> c) -> f a -> f b -> f c #
zapWithKey :: f (Key f -> a -> b) -> f a -> f b #
Instances
Indexable functors
class Lookup f => Indexable (f :: Type -> Type) where #
Instances
Safe Lookup
class Lookup (f :: Type -> Type) where #
Instances
Lookup ZipList # | |
Lookup Identity # | |
Lookup NonEmpty # | |
Lookup Par1 # | |
Lookup IntMap # | |
Lookup Seq # | |
Lookup Tree # | |
Lookup Maybe # | |
Lookup [] # | |
Lookup (Proxy :: Type -> Type) # | |
Ix i => Lookup (Array i) # | |
Lookup (U1 :: Type -> Type) # | |
Ord k => Lookup (Map k) # | |
Lookup f => Lookup (Cofree f) # | |
Lookup f => Lookup (Free f) # | |
(Eq k, Hashable k) => Lookup (HashMap k) # | |
Lookup (Const e :: Type -> Type) # | |
Lookup f => Lookup (Rec1 f) # | |
Lookup w => Lookup (TracedT s w) # | |
Lookup (Tagged a) # | |
Lookup m => Lookup (IdentityT m) # | |
Lookup m => Lookup (ReaderT e m) # | |
Lookup (Constant e :: Type -> Type) # | |
(Lookup f, Lookup g) => Lookup (Product f g) # | |
(Lookup f, Lookup g) => Lookup (Sum f g) # | |
(Indexable g, Indexable f) => Lookup (f :*: g) # | |
Lookup (K1 i c :: Type -> Type) # | |
Lookup ((->) a) # | |
(Lookup f, Lookup g) => Lookup (Compose f g) # | |
(Indexable g, Indexable f) => Lookup (g :.: f) # | |
Lookup f => Lookup (M1 i c f) # | |
lookupDefault :: Indexable f => Key f -> f a -> Maybe a #
Adjustable
class Functor f => Adjustable (f :: Type -> Type) where #
Minimal complete definition
Instances
Adjustable ZipList # | |
Adjustable Identity # | |
Adjustable NonEmpty # | |
Adjustable Par1 # | |
Adjustable IntMap # | |
Adjustable Seq # | |
Adjustable Tree # | |
Adjustable [] # | |
Adjustable (Proxy :: Type -> Type) # | |
Ix i => Adjustable (Array i) # | |
Adjustable (U1 :: Type -> Type) # | |
Ord k => Adjustable (Map k) # | |
Adjustable f => Adjustable (Cofree f) # | |
Adjustable f => Adjustable (Free f) # | |
Adjustable (Const e :: Type -> Type) # | |
Adjustable f => Adjustable (Rec1 f) # | |
Adjustable (Tagged a) # | |
Adjustable (Constant e :: Type -> Type) # | |
(Adjustable f, Adjustable g) => Adjustable (Product f g) # | |
(Adjustable f, Adjustable g) => Adjustable (Sum f g) # | |
(Adjustable f, Adjustable g) => Adjustable (f :*: g) # | |
(Adjustable f, Adjustable g) => Adjustable (f :+: g) # | |
Adjustable (K1 i c :: Type -> Type) # | |
(Adjustable f, Adjustable g) => Adjustable (g :.: f) # | |
Adjustable f => Adjustable (M1 i c f) # | |
FoldableWithKey
class Foldable t => FoldableWithKey (t :: Type -> Type) where #
Minimal complete definition
Methods
toKeyedList :: t a -> [(Key t, a)] #
foldMapWithKey :: Monoid m => (Key t -> a -> m) -> t a -> m #
foldrWithKey :: (Key t -> a -> b -> b) -> b -> t a -> b #
foldlWithKey :: (b -> Key t -> a -> b) -> b -> t a -> b #
Instances
foldrWithKey' :: FoldableWithKey t => (Key t -> a -> b -> b) -> b -> t a -> b #
foldlWithKey' :: FoldableWithKey t => (b -> Key t -> a -> b) -> b -> t a -> b #
foldrWithKeyM :: (FoldableWithKey t, Monad m) => (Key t -> a -> b -> m b) -> b -> t a -> m b #
foldlWithKeyM :: (FoldableWithKey t, Monad m) => (b -> Key t -> a -> m b) -> b -> t a -> m b #
traverseWithKey_ :: (FoldableWithKey t, Applicative f) => (Key t -> a -> f b) -> t a -> f () #
forWithKey_ :: (FoldableWithKey t, Applicative f) => t a -> (Key t -> a -> f b) -> f () #
mapWithKeyM_ :: (FoldableWithKey t, Monad m) => (Key t -> a -> m b) -> t a -> m () #
forWithKeyM_ :: (FoldableWithKey t, Monad m) => t a -> (Key t -> a -> m b) -> m () #
concatMapWithKey :: FoldableWithKey t => (Key t -> a -> [b]) -> t a -> [b] #
anyWithKey :: FoldableWithKey t => (Key t -> a -> Bool) -> t a -> Bool #
allWithKey :: FoldableWithKey t => (Key t -> a -> Bool) -> t a -> Bool #
findWithKey :: FoldableWithKey t => (Key t -> a -> Bool) -> t a -> Maybe a #
FoldableWithKey1
class (Foldable1 t, FoldableWithKey t) => FoldableWithKey1 (t :: Type -> Type) where #
Methods
foldMapWithKey1 :: Semigroup m => (Key t -> a -> m) -> t a -> m #
Instances
FoldableWithKey1 Identity # | |
FoldableWithKey1 NonEmpty # | |
FoldableWithKey1 Par1 # | |
FoldableWithKey1 Tree # | |
FoldableWithKey1 (V1 :: Type -> Type) # | |
FoldableWithKey1 f => FoldableWithKey1 (Cofree f) # | |
FoldableWithKey1 f => FoldableWithKey1 (Free f) # | |
FoldableWithKey1 ((,) k) # | |
FoldableWithKey1 f => FoldableWithKey1 (Rec1 f) # | |
FoldableWithKey1 (Tagged a) # | |
FoldableWithKey1 m => FoldableWithKey1 (IdentityT m) # | |
(FoldableWithKey1 f, FoldableWithKey1 g) => FoldableWithKey1 (Product f g) # | |
(FoldableWithKey1 f, FoldableWithKey1 g) => FoldableWithKey1 (Sum f g) # | |
(FoldableWithKey1 f, FoldableWithKey1 g) => FoldableWithKey1 (f :*: g) # | |
(FoldableWithKey1 f, FoldableWithKey1 g) => FoldableWithKey1 (f :+: g) # | |
(FoldableWithKey1 f, FoldableWithKey1 m) => FoldableWithKey1 (Compose f m) # | |
FoldableWithKey1 f => FoldableWithKey1 (M1 i c f) # | |
traverseWithKey1_ :: (FoldableWithKey1 t, Apply f) => (Key t -> a -> f b) -> t a -> f () #
forWithKey1_ :: (FoldableWithKey1 t, Apply f) => t a -> (Key t -> a -> f b) -> f () #
foldMapWithKeyDefault1 :: (FoldableWithKey1 t, Monoid m) => (Key t -> a -> m) -> t a -> m #
TraversableWithKey
class (Keyed t, FoldableWithKey t, Traversable t) => TraversableWithKey (t :: Type -> Type) where #
Minimal complete definition
Methods
traverseWithKey :: Applicative f => (Key t -> a -> f b) -> t a -> f (t b) #
mapWithKeyM :: Monad m => (Key t -> a -> m b) -> t a -> m (t b) #
Instances
TraversableWithKey ZipList # | |
Defined in Data.Key Methods traverseWithKey :: Applicative f => (Key ZipList -> a -> f b) -> ZipList a -> f (ZipList b) # mapWithKeyM :: Monad m => (Key ZipList -> a -> m b) -> ZipList a -> m (ZipList b) # | |
TraversableWithKey Identity # | |
Defined in Data.Key Methods traverseWithKey :: Applicative f => (Key Identity -> a -> f b) -> Identity a -> f (Identity b) # mapWithKeyM :: Monad m => (Key Identity -> a -> m b) -> Identity a -> m (Identity b) # | |
TraversableWithKey NonEmpty # | |
Defined in Data.Key Methods traverseWithKey :: Applicative f => (Key NonEmpty -> a -> f b) -> NonEmpty a -> f (NonEmpty b) # mapWithKeyM :: Monad m => (Key NonEmpty -> a -> m b) -> NonEmpty a -> m (NonEmpty b) # | |
TraversableWithKey Par1 # | |
Defined in Data.Key Methods traverseWithKey :: Applicative f => (Key Par1 -> a -> f b) -> Par1 a -> f (Par1 b) # mapWithKeyM :: Monad m => (Key Par1 -> a -> m b) -> Par1 a -> m (Par1 b) # | |
TraversableWithKey IntMap # | |
Defined in Data.Key Methods traverseWithKey :: Applicative f => (Key IntMap -> a -> f b) -> IntMap a -> f (IntMap b) # mapWithKeyM :: Monad m => (Key IntMap -> a -> m b) -> IntMap a -> m (IntMap b) # | |
TraversableWithKey Seq # | |
Defined in Data.Key Methods traverseWithKey :: Applicative f => (Key Seq -> a -> f b) -> Seq a -> f (Seq b) # mapWithKeyM :: Monad m => (Key Seq -> a -> m b) -> Seq a -> m (Seq b) # | |
TraversableWithKey Tree # | |
Defined in Data.Key Methods traverseWithKey :: Applicative f => (Key Tree -> a -> f b) -> Tree a -> f (Tree b) # mapWithKeyM :: Monad m => (Key Tree -> a -> m b) -> Tree a -> m (Tree b) # | |
TraversableWithKey Maybe # | |
Defined in Data.Key Methods traverseWithKey :: Applicative f => (Key Maybe -> a -> f b) -> Maybe a -> f (Maybe b) # mapWithKeyM :: Monad m => (Key Maybe -> a -> m b) -> Maybe a -> m (Maybe b) # | |
TraversableWithKey [] # | |
Defined in Data.Key Methods traverseWithKey :: Applicative f => (Key [] -> a -> f b) -> [a] -> f [b] # mapWithKeyM :: Monad m => (Key [] -> a -> m b) -> [a] -> m [b] # | |
TraversableWithKey (Proxy :: Type -> Type) # | |
Ix i => TraversableWithKey (Array i) # | |
Defined in Data.Key Methods traverseWithKey :: Applicative f => (Key (Array i) -> a -> f b) -> Array i a -> f (Array i b) # mapWithKeyM :: Monad m => (Key (Array i) -> a -> m b) -> Array i a -> m (Array i b) # | |
TraversableWithKey (U1 :: Type -> Type) # | |
TraversableWithKey (V1 :: Type -> Type) # | |
TraversableWithKey (Map k) # | |
Defined in Data.Key Methods traverseWithKey :: Applicative f => (Key (Map k) -> a -> f b) -> Map k a -> f (Map k b) # mapWithKeyM :: Monad m => (Key (Map k) -> a -> m b) -> Map k a -> m (Map k b) # | |
TraversableWithKey f => TraversableWithKey (Cofree f) # | |
Defined in Data.Key Methods traverseWithKey :: Applicative f0 => (Key (Cofree f) -> a -> f0 b) -> Cofree f a -> f0 (Cofree f b) # mapWithKeyM :: Monad m => (Key (Cofree f) -> a -> m b) -> Cofree f a -> m (Cofree f b) # | |
TraversableWithKey f => TraversableWithKey (Free f) # | |
Defined in Data.Key Methods traverseWithKey :: Applicative f0 => (Key (Free f) -> a -> f0 b) -> Free f a -> f0 (Free f b) # mapWithKeyM :: Monad m => (Key (Free f) -> a -> m b) -> Free f a -> m (Free f b) # | |
TraversableWithKey (HashMap k) # | |
Defined in Data.Key Methods traverseWithKey :: Applicative f => (Key (HashMap k) -> a -> f b) -> HashMap k a -> f (HashMap k b) # mapWithKeyM :: Monad m => (Key (HashMap k) -> a -> m b) -> HashMap k a -> m (HashMap k b) # | |
TraversableWithKey ((,) k) # | |
Defined in Data.Key Methods traverseWithKey :: Applicative f => (Key ((,) k) -> a -> f b) -> (k, a) -> f (k, b) # mapWithKeyM :: Monad m => (Key ((,) k) -> a -> m b) -> (k, a) -> m (k, b) # | |
TraversableWithKey (Const e :: Type -> Type) # | |
TraversableWithKey f => TraversableWithKey (Rec1 f) # | |
Defined in Data.Key Methods traverseWithKey :: Applicative f0 => (Key (Rec1 f) -> a -> f0 b) -> Rec1 f a -> f0 (Rec1 f b) # mapWithKeyM :: Monad m => (Key (Rec1 f) -> a -> m b) -> Rec1 f a -> m (Rec1 f b) # | |
TraversableWithKey (Tagged a) # | |
Defined in Data.Key Methods traverseWithKey :: Applicative f => (Key (Tagged a) -> a0 -> f b) -> Tagged a a0 -> f (Tagged a b) # mapWithKeyM :: Monad m => (Key (Tagged a) -> a0 -> m b) -> Tagged a a0 -> m (Tagged a b) # | |
TraversableWithKey m => TraversableWithKey (IdentityT m) # | |
Defined in Data.Key Methods traverseWithKey :: Applicative f => (Key (IdentityT m) -> a -> f b) -> IdentityT m a -> f (IdentityT m b) # mapWithKeyM :: Monad m0 => (Key (IdentityT m) -> a -> m0 b) -> IdentityT m a -> m0 (IdentityT m b) # | |
TraversableWithKey (Constant e :: Type -> Type) # | |
(TraversableWithKey f, TraversableWithKey g) => TraversableWithKey (Product f g) # | |
Defined in Data.Key Methods traverseWithKey :: Applicative f0 => (Key (Product f g) -> a -> f0 b) -> Product f g a -> f0 (Product f g b) # mapWithKeyM :: Monad m => (Key (Product f g) -> a -> m b) -> Product f g a -> m (Product f g b) # | |
(TraversableWithKey f, TraversableWithKey g) => TraversableWithKey (Sum f g) # | |
Defined in Data.Key Methods traverseWithKey :: Applicative f0 => (Key (Sum f g) -> a -> f0 b) -> Sum f g a -> f0 (Sum f g b) # mapWithKeyM :: Monad m => (Key (Sum f g) -> a -> m b) -> Sum f g a -> m (Sum f g b) # | |
(TraversableWithKey f, TraversableWithKey g) => TraversableWithKey (f :*: g) # | |
Defined in Data.Key Methods traverseWithKey :: Applicative f0 => (Key (f :*: g) -> a -> f0 b) -> (f :*: g) a -> f0 ((f :*: g) b) # mapWithKeyM :: Monad m => (Key (f :*: g) -> a -> m b) -> (f :*: g) a -> m ((f :*: g) b) # | |
(TraversableWithKey f, TraversableWithKey g) => TraversableWithKey (f :+: g) # | |
Defined in Data.Key Methods traverseWithKey :: Applicative f0 => (Key (f :+: g) -> a -> f0 b) -> (f :+: g) a -> f0 ((f :+: g) b) # mapWithKeyM :: Monad m => (Key (f :+: g) -> a -> m b) -> (f :+: g) a -> m ((f :+: g) b) # | |
TraversableWithKey (K1 i c :: Type -> Type) # | |
(TraversableWithKey f, TraversableWithKey m) => TraversableWithKey (Compose f m) # | |
Defined in Data.Key Methods traverseWithKey :: Applicative f0 => (Key (Compose f m) -> a -> f0 b) -> Compose f m a -> f0 (Compose f m b) # mapWithKeyM :: Monad m0 => (Key (Compose f m) -> a -> m0 b) -> Compose f m a -> m0 (Compose f m b) # | |
TraversableWithKey f => TraversableWithKey (M1 i c f) # | |
Defined in Data.Key Methods traverseWithKey :: Applicative f0 => (Key (M1 i c f) -> a -> f0 b) -> M1 i c f a -> f0 (M1 i c f b) # mapWithKeyM :: Monad m => (Key (M1 i c f) -> a -> m b) -> M1 i c f a -> m (M1 i c f b) # |
forWithKey :: (TraversableWithKey t, Applicative f) => t a -> (Key t -> a -> f b) -> f (t b) #
forWithKeyM :: (TraversableWithKey t, Monad m) => t a -> (Key t -> a -> m b) -> m (t b) #
mapAccumWithKeyL :: TraversableWithKey t => (Key t -> a -> b -> (a, c)) -> a -> t b -> (a, t c) #
The mapAccumWithKeyL
function behaves like a combination of mapWithKey
and foldlWithKey
; it applies a function to each element of a structure,
passing an accumulating parameter from left to right, and returning
a final value of this accumulator together with the new structure.
mapAccumWithKeyR :: TraversableWithKey t => (Key t -> a -> b -> (a, c)) -> a -> t b -> (a, t c) #
The mapAccumWithKeyR
function behaves like a combination of mapWithKey
and foldrWithKey
; it applies a function to each element of a structure,
passing an accumulating parameter from right to left, and returning
a final value of this accumulator together with the new structure.
mapWithKeyDefault :: TraversableWithKey t => (Key t -> a -> b) -> t a -> t b #
foldMapWithKeyDefault :: (TraversableWithKey t, Monoid m) => (Key t -> a -> m) -> t a -> m #
This function may be used as a value for foldMapWithKey
in a FoldableWithKey
instance.
TraversableWithKey1
class (Traversable1 t, FoldableWithKey1 t, TraversableWithKey t) => TraversableWithKey1 (t :: Type -> Type) where #
Methods
traverseWithKey1 :: Apply f => (Key t -> a -> f b) -> t a -> f (t b) #
Instances
TraversableWithKey1 Identity # | |
TraversableWithKey1 NonEmpty # | |
TraversableWithKey1 Par1 # | |
TraversableWithKey1 Tree # | |
TraversableWithKey1 (V1 :: Type -> Type) # | |
TraversableWithKey1 f => TraversableWithKey1 (Cofree f) # | |
TraversableWithKey1 f => TraversableWithKey1 (Free f) # | |
TraversableWithKey1 ((,) k) # | |
TraversableWithKey1 f => TraversableWithKey1 (Rec1 f) # | |
TraversableWithKey1 (Tagged a) # | |
TraversableWithKey1 m => TraversableWithKey1 (IdentityT m) # | |
(TraversableWithKey1 f, TraversableWithKey1 g) => TraversableWithKey1 (Product f g) # | |
(TraversableWithKey1 f, TraversableWithKey1 g) => TraversableWithKey1 (Sum f g) # | |
(TraversableWithKey1 f, TraversableWithKey1 g) => TraversableWithKey1 (f :*: g) # | |
(TraversableWithKey1 f, TraversableWithKey1 g) => TraversableWithKey1 (f :+: g) # | |
(TraversableWithKey1 f, TraversableWithKey1 m) => TraversableWithKey1 (Compose f m) # | |
TraversableWithKey1 f => TraversableWithKey1 (M1 i c f) # | |
foldMapWithKey1Default :: (TraversableWithKey1 t, Semigroup m) => (Key t -> a -> m) -> t a -> m #