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

Moduleindexed-traversable-0.1.4Haskell2010

Data.Functor.WithIndex

  • 1 class

Indexed Functors

1 declaration
classclass Functor f => FunctorWithIndex i (f :: Type -> Type) | f -> i where
#

A Functor with an additional index.

Instances must satisfy a modified form of the Functor laws:

imap f . imap g ≡ imap (\i -> f i . g i)
imap (\_ a -> a) ≡ id

Methods

  • imap :: (i -> a -> b) -> f a -> f b

    Map with access to the index.

Instances30FunctorWithIndex, …