indexed-traversable: FunctorWithIndex, FoldableWithIndex, TraversableWithIndex

[ bsd2, data, library ] [ Propose Tags ] [ Report a vulnerability ]

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.

Flags

Automatic Flags
NameDescriptionDefault
base-ge-4-18

base >=4.18 (GHC-9.6)

Enabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1, 0.1.1, 0.1.2, 0.1.2.1, 0.1.3, 0.1.4, 0.1.5
Change log Changelog.md
Dependencies array (>=0.3.0.2 && <0.6), base (>=4.12 && <4.23), containers (>=0.6.0.1 && <0.9), foldable1-classes-compat (>=0.1 && <0.2), transformers (>=0.5.6.0 && <0.7) [details]
Tested with ghc ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.6 || ==9.8.4 || ==9.10.1 || ==9.12.4 || ==9.14.1
License BSD-2-Clause
Author Edward Kmett
Maintainer Oleg Grenrus <oleg.grenrus@iki.fi>
Uploaded by phadej at 2026-05-07T19:29:13Z
Category Data
Source repo head: git clone https://github.com/haskellari/indexed-traversable(indexed-traversable)
Distributions Arch:0.1.4, LTSHaskell:0.1.4, Stackage:0.1.4
Reverse Dependencies 51 direct, 9470 indirect [details]
Downloads 28700 total (40 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2026-05-07 [all 1 reports]