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 bMap with access to the index.
Instances30FunctorWithIndex, …
FunctorWithIndex Int IntMapDefined in indexed-traversable-0.1.4 · WithIndexFunctorWithIndex Int SeqDefined in indexed-traversable-0.1.4 · WithIndexThe position in the Seq is available as the index.
FunctorWithIndex Int NonEmptyDefined in indexed-traversable-0.1.4 · WithIndexFunctorWithIndex Int ZipListDefined in indexed-traversable-0.1.4 · WithIndexSame instance as for
[].FunctorWithIndex Int []Defined in indexed-traversable-0.1.4 · WithIndexThe position in the list is available as the index.
FunctorWithIndex () IdentityDefined in indexed-traversable-0.1.4 · WithIndexFunctorWithIndex () Par1Defined in indexed-traversable-0.1.4 · WithIndexFunctorWithIndex () MaybeDefined in indexed-traversable-0.1.4 · WithIndexIx i => FunctorWithIndex i (Array i)Defined in indexed-traversable-0.1.4 · WithIndexFunctorWithIndex Void ProxyDefined in indexed-traversable-0.1.4 · WithIndexFunctorWithIndex Void U1Defined in indexed-traversable-0.1.4 · WithIndexFunctorWithIndex Void V1Defined in indexed-traversable-0.1.4 · WithIndexFunctorWithIndex k (Map k)Defined in indexed-traversable-0.1.4 · WithIndexFunctorWithIndex k (Tuple2 k)Defined in indexed-traversable-0.1.4 · WithIndexFunctorWithIndex Void (Const e)Defined in indexed-traversable-0.1.4 · WithIndexFunctorWithIndex Void (Constant e)Defined in indexed-traversable-0.1.4 · WithIndexFunctorWithIndex i f => FunctorWithIndex i (Rec1 f)Defined in indexed-traversable-0.1.4 · WithIndexFunctorWithIndex i f => FunctorWithIndex i (Backwards f)Defined in indexed-traversable-0.1.4 · WithIndexFunctorWithIndex i f => FunctorWithIndex i (Reverse f)Defined in indexed-traversable-0.1.4 · WithIndexFunctorWithIndex i m => FunctorWithIndex i (IdentityT m)Defined in indexed-traversable-0.1.4 · WithIndexFunctorWithIndex Void (K1 i c)Defined in indexed-traversable-0.1.4 · WithIndexFunctorWithIndex r ((->) r)Defined in indexed-traversable-0.1.4 · WithIndexFunctorWithIndex [Int] TreeDefined in indexed-traversable-0.1.4 · WithIndexFunctorWithIndex i m => FunctorWithIndex (e, i) (ReaderT e m)Defined in indexed-traversable-0.1.4 · WithIndex(FunctorWithIndex i f, FunctorWithIndex j g) => FunctorWithIndex (Either i j) (Product f g)Defined in indexed-traversable-0.1.4 · WithIndex(FunctorWithIndex i f, FunctorWithIndex j g) => FunctorWithIndex (Either i j) (Sum f g)Defined in indexed-traversable-0.1.4 · WithIndex(FunctorWithIndex i f, FunctorWithIndex j g) => FunctorWithIndex (Either i j) (f :*: g)Defined in indexed-traversable-0.1.4 · WithIndex(FunctorWithIndex i f, FunctorWithIndex j g) => FunctorWithIndex (Either i j) (f :+: g)Defined in indexed-traversable-0.1.4 · WithIndex(FunctorWithIndex i f, FunctorWithIndex j g) => FunctorWithIndex (i, j) (Compose f g)Defined in indexed-traversable-0.1.4 · WithIndex(FunctorWithIndex i f, FunctorWithIndex j g) => FunctorWithIndex (i, j) (f :.: g)Defined in indexed-traversable-0.1.4 · WithIndex