{-# LANGUAGE Rank2Types #-}
module Data.Array.Lens
(
ixmapped
) where
import Control.Lens
import Data.Array.IArray hiding (index)
ixmapped :: (IArray a e, Ix i, Ix j) => (i,i) -> IndexPreservingSetter (a j e) (a i e) i j
ixmapped :: forall (a :: * -> * -> *) e i j.
(IArray a e, Ix i, Ix j) =>
(i, i) -> IndexPreservingSetter (a j e) (a i e) i j
ixmapped (i, i)
i = ((i -> j) -> a j e -> a i e)
-> IndexPreservingSetter (a j e) (a i e) i j
forall a b s t.
((a -> b) -> s -> t) -> IndexPreservingSetter s t a b
setting (((i -> j) -> a j e -> a i e)
-> IndexPreservingSetter (a j e) (a i e) i j)
-> ((i -> j) -> a j e -> a i e)
-> IndexPreservingSetter (a j e) (a i e) i j
forall a b. (a -> b) -> a -> b
$ (i, i) -> (i -> j) -> a j e -> a i e
forall (a :: * -> * -> *) e i j.
(IArray a e, Ix i, Ix j) =>
(i, i) -> (i -> j) -> a j e -> a i e
ixmap (i, i)
i
{-# INLINE ixmapped #-}