HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Package0.1.4Data

indexed-traversable

FunctorWithIndex, FoldableWithIndex, TraversableWithIndex

Modules

4 modules

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

Used by in this set · 15