lens-3.8.7.3: Lenses, Folds and Traversals

Portability | MPTCs, Rank2Types, LiberalTypeSynonyms
Stability | provisional
Maintainer | Edward Kmett <ekmett@gmail.com>
Safe Haskell | None

Data.Array.Lens

Contents

- Setters

Description

Synopsis

- ixmapped :: (IArray a e, Ix i, Ix j) => (i, i) -> IndexPreservingSetter (a j e) (a i e) i j

# Setters

ixmapped :: (IArray a e, Ix i, Ix j) => (i, i) -> IndexPreservingSetter (a j e) (a i e) i j

This `setter` can be used to derive a new `IArray` from an old `IAarray` by applying a function to each of the indices to look it up in the old `IArray`.

This is a contravariant `Setter`.

     ixmap ≡ over . ixmapped
     ixmapped ≡ setting . ixmap
     over (ixmapped b) f arr ! i ≡ arr ! f i
     bounds (over (ixmapped b) f arr) ≡ b