Module

Data.FunctorWithIndex

Package
purescript-foldable-traversable
Repository
purescript/purescript-foldable-traversable

#FunctorWithIndex Source

class (Functor f) <= FunctorWithIndex i f | f -> i where

A Functor with an additional index.
Instances must satisfy a modified form of the Functor laws

mapWithIndex (\_ a -> a) = id
mapWithIndex f . mapWithIndex g = mapWithIndex (\i -> f i <<< g i)

and be compatible with the Functor instance

map f = mapWithIndex (const f)

Members

Instances