Package0.1.4Data
indexed-traversable
FunctorWithIndex, FoldableWithIndex, TraversableWithIndex
- Version0.1.4
- CategoryData
- LicenceBSD-2-Clause
- AuthorEdward Kmett
- MaintainerOleg Grenrus <oleg.grenrus@iki.fi>
- Pinned byhackage indexed-traversable 0.1.4
- Sourcehackage.haskell.org/package/indexed-traversable-0.1.4
Modules
4 modules- Data.Foldable.WithIndex14Indexed Foldables.
- Data.Foldable1.WithIndex1Indexed non-empty Foldables.
- Data.Functor.WithIndex1
- Data.Traversable.WithIndex8Indexed Traversables
Description
This package provides three useful generalizations:
class Functor f => FunctorWithIndex i f | f -> i where imap :: (i -> a -> b) -> f a -> f b
class Foldable f => FoldableWithIndex i f | f -> i where ifoldMap :: Monoid m => (i -> a -> m) -> f a -> m
class (FunctorWithIndex i t, FoldableWithIndex i t, Traversable t) => TraversableWithIndex i t | t -> i where itraverse :: Applicative f => (i -> a -> f b) -> t a -> f (t b)
This package contains instances for types in GHC boot libraries. For some additional instances see indexed-traversable-instances.
The keys package provides similar functionality, but uses (associated) TypeFamilies instead of FunctionalDependencies.
Depends on
4 packages- array-0.5.8.0with GHC
- base-4.20.2.0with GHC
- containers-0.7with GHC
- transformers-0.6.1.1with GHC