indexed-traversable

Version 0.1.4 revision 0 uploaded by phadej.

Package meta

Synopsis
FunctorWithIndex, FoldableWithIndex, TraversableWithIndex
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.

Author
Edward Kmett
Bug reports
n/a
Category
Data
Copyright
n/a
Homepage
n/a
Maintainer
Oleg Grenrus <oleg.grenrus@iki.fi>
Package URL
n/a
Stability
n/a

Components