lens-5.2.3: Lenses, Folds and Traversals
Copyright(C) 2012-16 Edward Kmett
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityprovisional
PortabilityMPTCs, Rank2Types, LiberalTypeSynonyms
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Array.Lens

Contents

Description

 
Synopsis

Setters

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

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

This is a contravariant Setter.

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