ral-optics-0.1: Length-indexed random access lists: optics utilities.

Safe HaskellNone
LanguageHaskell2010

Data.RAVec.Optics

Contents

Synopsis

Indexing

ix :: Pos b -> Lens' (RAVec b a) a Source #

Index lens.

>>> let Just ral = fromList "xyz" :: Maybe (RAVec B.Bin3 Char)
>>> set (ix maxBound) 'Z' ral
NonEmpty (NE (Cons1 (Leaf 'x') (Last (Node (Leaf 'y') (Leaf 'Z')))))

Orphan instances

FunctorWithIndex (Pos b) (RAVec b) Source # 
Instance details

Methods

imap :: (Pos b -> a -> b0) -> RAVec b a -> RAVec b b0 #

FoldableWithIndex (Pos b) (RAVec b) Source # 
Instance details

Methods

ifoldMap :: Monoid m => (Pos b -> a -> m) -> RAVec b a -> m #

ifoldr :: (Pos b -> a -> b0 -> b0) -> b0 -> RAVec b a -> b0 #

ifoldl' :: (Pos b -> b0 -> a -> b0) -> b0 -> RAVec b a -> b0 #

TraversableWithIndex (Pos b) (RAVec b) Source # 
Instance details

Methods

itraverse :: Applicative f => (Pos b -> a -> f b0) -> RAVec b a -> f (RAVec b b0) #

Each (Pos n) (RAVec n a) (RAVec n b) a b Source # 
Instance details

Methods

each :: IxTraversal (Pos n) (RAVec n a) (RAVec n b) a b #

Ixed (RAVec b a) Source # 
Instance details

Associated Types

type IxKind (RAVec b a) :: OpticKind #

Methods

ix :: Index (RAVec b a) -> Optic' (IxKind (RAVec b a)) NoIx (RAVec b a) (IxValue (RAVec b a)) #