@hackage indexed-traversable0.1
FunctorWithIndex, FoldableWithIndex, TraversableWithIndex
Installation
Tested Compilers
Dependencies (11)
- array >=0.3.0.2 && <0.6
- base >=4.3 && <4.16
- base-orphans >=0.8.3 && <0.9
- containers >=0.4.0.0 && <0.7
- generic-deriving >=1.14 && <1.15
- ghc-prim Show all…
Dependents (57)
@hackage/rrb-vector, @hackage/mappings, @hackage/free, @hackage/changeset, @hackage/optics-core, @hackage/heist-emanote, Show all…
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.