FunctorWithIndex, FoldableWithIndex, TraversableWithIndex

Version on this page:0.1.1
LTS Haskell 22.12:0.1.3
Stackage Nightly 2024-03-01:0.1.3
Latest on Hackage:0.1.3

See all snapshots indexed-traversable appears in

BSD-2-Clause licensed by Edward Kmett
Maintained by Oleg Grenrus
This version can be pinned in stack with:indexed-traversable-0.1.1@sha256:e330ec1ab336ee2fb1eff117ebe3480d1663396fecd981f185b7123dc7941ae1,2469

Module documentation for 0.1.1

Used by 2 packages in lts-17.2(full list with versions):

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.


0.1.1 [2020-12-27]

0.1 [2020-12-15]

  • Split out and combine this package functionality from lens and optics