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

Safe HaskellNone
LanguageHaskell2010

Data.RAVec.Tree.Lens

Contents

Synopsis

Indexing

ix :: Wrd n -> Lens' (Tree n a) a Source #

Index lens.

>>> let tree = Node (Node (Leaf 'a') (Leaf 'b')) (Node (Leaf 'c') (Leaf 'd'))
>>> tree & ix (W1 $ W0 WE) .~ 'z'
Node (Node (Leaf 'a') (Leaf 'b')) (Node (Leaf 'z') (Leaf 'd'))

Orphan instances

FunctorWithIndex (Wrd n) (Tree n) Source # 
Instance details

Methods

imap :: (Wrd n -> a -> b) -> Tree n a -> Tree n b #

imapped :: IndexedSetter (Wrd n) (Tree n a) (Tree n b) a b #

FoldableWithIndex (Wrd n) (Tree n) Source # 
Instance details

Methods

ifoldMap :: Monoid m => (Wrd n -> a -> m) -> Tree n a -> m #

ifolded :: IndexedFold (Wrd n) (Tree n a) a #

ifoldr :: (Wrd n -> a -> b -> b) -> b -> Tree n a -> b #

ifoldl :: (Wrd n -> b -> a -> b) -> b -> Tree n a -> b #

ifoldr' :: (Wrd n -> a -> b -> b) -> b -> Tree n a -> b #

ifoldl' :: (Wrd n -> b -> a -> b) -> b -> Tree n a -> b #

TraversableWithIndex (Wrd n) (Tree n) Source # 
Instance details

Methods

itraverse :: Applicative f => (Wrd n -> a -> f b) -> Tree n a -> f (Tree n b) #

itraversed :: IndexedTraversal (Wrd n) (Tree n a) (Tree n b) a b #

Ixed (Tree n a) Source # 
Instance details

Methods

ix :: Index (Tree n a) -> Traversal' (Tree n a) (IxValue (Tree n a)) #

Each (Tree n a) (Tree n b) a b Source # 
Instance details

Methods

each :: Traversal (Tree n a) (Tree n b) a b #